From 1178d31d1f21949cb6742dfb0d8aaebd2c434ed7 Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 20 Apr 2016 15:57:18 +0800 Subject: [PATCH] update petstore sample --- .../Classes/Swaggers/APIs/PetAPI.swift | 385 ++++-------------- .../Classes/Swaggers/APIs/StoreAPI.swift | 217 ++-------- .../Classes/Swaggers/APIs/UserAPI.swift | 55 ++- .../Swaggers/AlamofireImplementations.swift | 2 +- .../Classes/Swaggers/Models.swift | 136 ------- .../Classes/Swaggers/Models/Animal.swift | 23 -- .../Classes/Swaggers/Models/Cat.swift | 25 -- .../Classes/Swaggers/Models/Dog.swift | 25 -- .../Classes/Swaggers/Models/FormatTest.swift | 46 --- .../Swaggers/Models/InlineResponse200.swift | 40 -- .../Swaggers/Models/Model200Response.swift | 24 -- .../Classes/Swaggers/Models/ModelReturn.swift | 24 -- .../Classes/Swaggers/Models/Name.swift | 26 -- .../Swaggers/Models/ObjectReturn.swift | 25 -- .../Swaggers/Models/SpecialModelName.swift | 24 -- 15 files changed, 144 insertions(+), 933 deletions(-) delete mode 100644 samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Animal.swift delete mode 100644 samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Cat.swift delete mode 100644 samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Dog.swift delete mode 100644 samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift delete mode 100644 samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/InlineResponse200.swift delete mode 100644 samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift delete mode 100644 samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/ModelReturn.swift delete mode 100644 samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Name.swift delete mode 100644 samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/ObjectReturn.swift delete mode 100644 samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index 1d39c7885d3..64aa3c8803c 100644 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -63,58 +63,6 @@ public class PetAPI: APIBase { return requestBuilder.init(method: "POST", URLString: URLString, parameters: parameters, isBody: true) } - /** - Fake endpoint to test byte array in body parameter for adding a new pet to the store - - - parameter body: (body) Pet object in the form of byte array (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func addPetUsingByteArray(body body: String? = nil, completion: ((error: ErrorType?) -> Void)) { - addPetUsingByteArrayWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error: error); - } - } - - /** - Fake endpoint to test byte array in body parameter for adding a new pet to the store - - - parameter body: (body) Pet object in the form of byte array (optional) - - returns: Promise - */ - public class func addPetUsingByteArray(body body: String? = nil) -> Promise { - let deferred = Promise.pendingPromise() - addPetUsingByteArray(body: body) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Fake endpoint to test byte array in body parameter for adding a new pet to the store - - POST /pet?testing_byte_array=true - - - - OAuth: - - type: oauth2 - - name: petstore_auth - - - parameter body: (body) Pet object in the form of byte array (optional) - - - returns: RequestBuilder - */ - public class func addPetUsingByteArrayWithRequestBuilder(body body: String? = nil) -> RequestBuilder { - let path = "/pet?testing_byte_array=true" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: parameters, isBody: true) - } - /** Deletes a pet @@ -173,7 +121,7 @@ public class PetAPI: APIBase { /** Finds Pets by status - - parameter status: (query) Status values that need to be considered for query (optional, default to available) + - parameter status: (query) Status values that need to be considered for filter (optional, default to available) - 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)) { @@ -185,7 +133,7 @@ public class PetAPI: APIBase { /** Finds Pets by status - - parameter status: (query) Status values that need to be considered for query (optional, default to available) + - parameter status: (query) Status values that need to be considered for filter (optional, default to available) - returns: Promise<[Pet]> */ public class func findPetsByStatus(status status: [String]? = nil) -> Promise<[Pet]> { @@ -203,58 +151,19 @@ public class PetAPI: APIBase { /** Finds Pets by status - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings + - Multiple status values can be provided with comma seperated strings - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example=[ { - "photoUrls" : [ "aeiou" ], - "name" : "doggie", - "id" : 123456789, - "category" : { - "name" : "aeiou", - "id" : 123456789 - }, - "tags" : [ { - "name" : "aeiou", - "id" : 123456789 - } ], - "status" : "aeiou" -} ]}, {contentType=application/xml, example= - 123456 - doggie - - string - - - - string -}] - - examples: [{contentType=application/json, example=[ { - "photoUrls" : [ "aeiou" ], - "name" : "doggie", - "id" : 123456789, - "category" : { - "name" : "aeiou", - "id" : 123456789 - }, - "tags" : [ { - "name" : "aeiou", - "id" : 123456789 - } ], - "status" : "aeiou" -} ]}, {contentType=application/xml, example= - 123456 - doggie - - string - - - - string -}] + - examples: [{example={ + "name" : "Puma", + "type" : "Dog", + "color" : "Black", + "gender" : "Female", + "breed" : "Mixed" +}, contentType=application/json}] - - parameter status: (query) Status values that need to be considered for query (optional, default to available) + - parameter status: (query) Status values that need to be considered for filter (optional, default to available) - returns: RequestBuilder<[Pet]> */ @@ -309,20 +218,20 @@ public class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example=[ { - "photoUrls" : [ "aeiou" ], - "name" : "doggie", + - examples: [{example=[ { + "tags" : [ { + "id" : 123456789, + "name" : "aeiou" + } ], "id" : 123456789, "category" : { - "name" : "aeiou", - "id" : 123456789 + "id" : 123456789, + "name" : "aeiou" }, - "tags" : [ { - "name" : "aeiou", - "id" : 123456789 - } ], - "status" : "aeiou" -} ]}, {contentType=application/xml, example= + "status" : "aeiou", + "name" : "doggie", + "photoUrls" : [ "aeiou" ] +} ], contentType=application/json}, {example= 123456 doggie @@ -331,21 +240,21 @@ public class PetAPI: APIBase { string -}] - - examples: [{contentType=application/json, example=[ { - "photoUrls" : [ "aeiou" ], - "name" : "doggie", +, contentType=application/xml}] + - examples: [{example=[ { + "tags" : [ { + "id" : 123456789, + "name" : "aeiou" + } ], "id" : 123456789, "category" : { - "name" : "aeiou", - "id" : 123456789 + "id" : 123456789, + "name" : "aeiou" }, - "tags" : [ { - "name" : "aeiou", - "id" : 123456789 - } ], - "status" : "aeiou" -} ]}, {contentType=application/xml, example= + "status" : "aeiou", + "name" : "doggie", + "photoUrls" : [ "aeiou" ] +} ], contentType=application/json}, {example= 123456 doggie @@ -354,7 +263,7 @@ public class PetAPI: APIBase { string -}] +, contentType=application/xml}] - parameter tags: (query) Tags to filter by (optional) @@ -408,26 +317,26 @@ public class PetAPI: APIBase { Find pet by ID - GET /pet/{petId} - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - - OAuth: - - type: oauth2 - - name: petstore_auth - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "aeiou" ], - "name" : "doggie", + - OAuth: + - type: oauth2 + - name: petstore_auth + - examples: [{example={ + "tags" : [ { + "id" : 123456789, + "name" : "aeiou" + } ], "id" : 123456789, "category" : { - "name" : "aeiou", - "id" : 123456789 + "id" : 123456789, + "name" : "aeiou" }, - "tags" : [ { - "name" : "aeiou", - "id" : 123456789 - } ], - "status" : "aeiou" -}}, {contentType=application/xml, example= + "status" : "aeiou", + "name" : "doggie", + "photoUrls" : [ "aeiou" ] +}, contentType=application/json}, {example= 123456 doggie @@ -436,21 +345,21 @@ public class PetAPI: APIBase { string -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "aeiou" ], - "name" : "doggie", +, contentType=application/xml}] + - examples: [{example={ + "tags" : [ { + "id" : 123456789, + "name" : "aeiou" + } ], "id" : 123456789, "category" : { - "name" : "aeiou", - "id" : 123456789 + "id" : 123456789, + "name" : "aeiou" }, - "tags" : [ { - "name" : "aeiou", - "id" : 123456789 - } ], - "status" : "aeiou" -}}, {contentType=application/xml, example= + "status" : "aeiou", + "name" : "doggie", + "photoUrls" : [ "aeiou" ] +}, contentType=application/json}, {example= 123456 doggie @@ -459,7 +368,7 @@ public class PetAPI: APIBase { string -}] +, contentType=application/xml}] - parameter petId: (path) ID of pet that needs to be fetched @@ -478,158 +387,6 @@ public class PetAPI: APIBase { return requestBuilder.init(method: "GET", URLString: URLString, parameters: parameters, isBody: true) } - /** - Fake endpoint to test inline arbitrary object return by '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 getPetByIdInObject(petId petId: Int64, completion: ((data: InlineResponse200?, error: ErrorType?) -> Void)) { - getPetByIdInObjectWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(data: response?.body, error: error); - } - } - - /** - Fake endpoint to test inline arbitrary object return by 'Find pet by ID' - - - parameter petId: (path) ID of pet that needs to be fetched - - returns: Promise - */ - public class func getPetByIdInObject(petId petId: Int64) -> Promise { - let deferred = Promise.pendingPromise() - getPetByIdInObject(petId: petId) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Fake endpoint to test inline arbitrary object return by 'Find pet by ID' - - GET /pet/{petId}?response=inline_arbitrary_object - - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - - OAuth: - - type: oauth2 - - name: petstore_auth - - API Key: - - type: apiKey api_key - - name: api_key - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "aeiou" ], - "name" : "doggie", - "id" : 123456789, - "category" : "{}", - "tags" : [ { - "name" : "aeiou", - "id" : 123456789 - } ], - "status" : "aeiou" -}}, {contentType=application/xml, example= - string - doggie - 123456 - not implemented io.swagger.models.properties.ObjectProperty@37ff6855 - string -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "aeiou" ], - "name" : "doggie", - "id" : 123456789, - "category" : "{}", - "tags" : [ { - "name" : "aeiou", - "id" : 123456789 - } ], - "status" : "aeiou" -}}, {contentType=application/xml, example= - string - doggie - 123456 - not implemented io.swagger.models.properties.ObjectProperty@37ff6855 - string -}] - - - parameter petId: (path) ID of pet that needs to be fetched - - - returns: RequestBuilder - */ - public class func getPetByIdInObjectWithRequestBuilder(petId petId: Int64) -> RequestBuilder { - var path = "/pet/{petId}?response=inline_arbitrary_object" - 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 requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: parameters, isBody: true) - } - - /** - Fake endpoint to test byte array return by '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 petPetIdtestingByteArraytrueGet(petId petId: Int64, completion: ((data: String?, error: ErrorType?) -> Void)) { - petPetIdtestingByteArraytrueGetWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(data: response?.body, error: error); - } - } - - /** - Fake endpoint to test byte array return by 'Find pet by ID' - - - parameter petId: (path) ID of pet that needs to be fetched - - returns: Promise - */ - public class func petPetIdtestingByteArraytrueGet(petId petId: Int64) -> Promise { - let deferred = Promise.pendingPromise() - petPetIdtestingByteArraytrueGet(petId: petId) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Fake endpoint to test byte array return by 'Find pet by ID' - - GET /pet/{petId}?testing_byte_array=true - - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - - OAuth: - - type: oauth2 - - name: petstore_auth - - API Key: - - type: apiKey api_key - - name: api_key - - examples: [{contentType=application/json, example=""}, {contentType=application/xml, example=not implemented io.swagger.models.properties.BinaryProperty@55e6ae9e}] - - examples: [{contentType=application/json, example=""}, {contentType=application/xml, example=not implemented io.swagger.models.properties.BinaryProperty@55e6ae9e}] - - - parameter petId: (path) ID of pet that needs to be fetched - - - returns: RequestBuilder - */ - public class func petPetIdtestingByteArraytrueGetWithRequestBuilder(petId petId: Int64) -> RequestBuilder { - var path = "/pet/{petId}?testing_byte_array=true" - 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 requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: parameters, isBody: true) - } - /** Update an existing pet @@ -751,11 +508,11 @@ public class PetAPI: APIBase { - 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 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 { (response, error) -> Void in + 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 { (response, error) -> Void in completion(error: error); } } @@ -765,12 +522,12 @@ public class PetAPI: APIBase { - 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 file: (form) file to upload (optional) - returns: Promise */ - public class func uploadFile(petId petId: Int64, additionalMetadata: String? = nil, _file: NSURL? = nil) -> 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 + uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file) { error in if let error = error { deferred.reject(error) } else { @@ -790,18 +547,18 @@ public class PetAPI: APIBase { - 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 file: (form) file to upload (optional) - returns: RequestBuilder */ - public class func uploadFileWithRequestBuilder(petId petId: Int64, additionalMetadata: String? = nil, _file: NSURL? = nil) -> 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 + "file": file ] let parameters = APIHelper.rejectNil(nillableParameters) diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index f4f0cea288b..4521afd3d89 100644 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -63,95 +63,6 @@ public class StoreAPI: APIBase { return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: parameters, isBody: true) } - /** - Finds orders by status - - - parameter status: (query) Status value that needs to be considered for query (optional, default to placed) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func findOrdersByStatus(status status: String? = nil, completion: ((data: [Order]?, error: ErrorType?) -> Void)) { - findOrdersByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(data: response?.body, error: error); - } - } - - /** - Finds orders by status - - - parameter status: (query) Status value that needs to be considered for query (optional, default to placed) - - returns: Promise<[Order]> - */ - public class func findOrdersByStatus(status status: String? = nil) -> Promise<[Order]> { - let deferred = Promise<[Order]>.pendingPromise() - findOrdersByStatus(status: status) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Finds orders by status - - GET /store/findByStatus - - A single status value can be provided as a string - - API Key: - - type: apiKey x-test_api_client_id - - name: test_api_client_id - - API Key: - - type: apiKey x-test_api_client_secret - - name: test_api_client_secret - - examples: [{contentType=application/json, example=[ { - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, - "shipDate" : "2000-01-23T04:56:07.000+0000", - "complete" : true, - "status" : "aeiou" -} ]}, {contentType=application/xml, example= - 123456 - 123456 - 0 - 2000-01-23T04:56:07.000Z - string - true -}] - - examples: [{contentType=application/json, example=[ { - "petId" : 123456789, - "quantity" : 123, - "id" : 123456789, - "shipDate" : "2000-01-23T04:56:07.000+0000", - "complete" : true, - "status" : "aeiou" -} ]}, {contentType=application/xml, example= - 123456 - 123456 - 0 - 2000-01-23T04:56:07.000Z - string - true -}] - - - parameter status: (query) Status value that needs to be considered for query (optional, default to placed) - - - returns: RequestBuilder<[Order]> - */ - public class func findOrdersByStatusWithRequestBuilder(status status: String? = nil) -> RequestBuilder<[Order]> { - let path = "/store/findByStatus" - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String:AnyObject?] = [ - "status": status - ] - let parameters = APIHelper.rejectNil(nillableParameters) - - let requestBuilder: RequestBuilder<[Order]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: parameters, isBody: false) - } - /** Returns pet inventories by status @@ -187,12 +98,12 @@ public class StoreAPI: APIBase { - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/json, example={ + - examples: [{example={ "key" : 123 -}}, {contentType=application/xml, example=not implemented io.swagger.models.properties.MapProperty@d1e580af}] - - examples: [{contentType=application/json, example={ +}, contentType=application/json}, {example=not implemented io.swagger.models.properties.MapProperty@d1e580af, contentType=application/xml}] + - examples: [{example={ "key" : 123 -}}, {contentType=application/xml, example=not implemented io.swagger.models.properties.MapProperty@d1e580af}] +}, contentType=application/json}, {example=not implemented io.swagger.models.properties.MapProperty@d1e580af, contentType=application/xml}] - returns: RequestBuilder<[String:Int32]> */ @@ -208,58 +119,6 @@ public class StoreAPI: APIBase { return requestBuilder.init(method: "GET", URLString: URLString, parameters: parameters, isBody: true) } - /** - Fake endpoint to test arbitrary object return by 'Get inventory' - - - parameter completion: completion handler to receive the data and the error objects - */ - public class func getInventoryInObject(completion: ((data: AnyObject?, error: ErrorType?) -> Void)) { - getInventoryInObjectWithRequestBuilder().execute { (response, error) -> Void in - completion(data: response?.body, error: error); - } - } - - /** - Fake endpoint to test arbitrary object return by 'Get inventory' - - - returns: Promise - */ - public class func getInventoryInObject() -> Promise { - let deferred = Promise.pendingPromise() - getInventoryInObject() { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Fake endpoint to test arbitrary object return by 'Get inventory' - - GET /store/inventory?response=arbitrary_object - - Returns an arbitrary object which is actually a map of status codes to quantities - - API Key: - - type: apiKey api_key - - name: api_key - - examples: [{contentType=application/json, example="{}"}, {contentType=application/xml, example=not implemented io.swagger.models.properties.ObjectProperty@37aadb4f}] - - examples: [{contentType=application/json, example="{}"}, {contentType=application/xml, example=not implemented io.swagger.models.properties.ObjectProperty@37aadb4f}] - - - returns: RequestBuilder - */ - public class func getInventoryInObjectWithRequestBuilder() -> RequestBuilder { - let path = "/store/inventory?response=arbitrary_object" - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String:AnyObject?] = [:] - let parameters = APIHelper.rejectNil(nillableParameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: parameters, isBody: true) - } - /** Find purchase order by ID @@ -294,42 +153,36 @@ public class StoreAPI: APIBase { 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 - - API Key: - - type: apiKey test_api_key_query (QUERY) - - name: test_api_key_query - - API Key: - - type: apiKey test_api_key_header - - name: test_api_key_header - - examples: [{contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, + - examples: [{example={ "id" : 123456789, - "shipDate" : "2000-01-23T04:56:07.000+0000", + "petId" : 123456789, "complete" : true, - "status" : "aeiou" -}}, {contentType=application/xml, example= + "status" : "aeiou", + "quantity" : 123, + "shipDate" : "2000-01-23T04:56:07.000+0000" +}, contentType=application/json}, {example= 123456 123456 0 2000-01-23T04:56:07.000Z string true -}] - - examples: [{contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, +, contentType=application/xml}] + - examples: [{example={ "id" : 123456789, - "shipDate" : "2000-01-23T04:56:07.000+0000", + "petId" : 123456789, "complete" : true, - "status" : "aeiou" -}}, {contentType=application/xml, example= + "status" : "aeiou", + "quantity" : 123, + "shipDate" : "2000-01-23T04:56:07.000+0000" +}, contentType=application/json}, {example= 123456 123456 0 2000-01-23T04:56:07.000Z string true -}] +, contentType=application/xml}] - parameter orderId: (path) ID of pet that needs to be fetched @@ -382,42 +235,36 @@ public class StoreAPI: APIBase { Place an order for a pet - POST /store/order - - - API Key: - - type: apiKey x-test_api_client_id - - name: test_api_client_id - - API Key: - - type: apiKey x-test_api_client_secret - - name: test_api_client_secret - - examples: [{contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, + - examples: [{example={ "id" : 123456789, - "shipDate" : "2000-01-23T04:56:07.000+0000", + "petId" : 123456789, "complete" : true, - "status" : "aeiou" -}}, {contentType=application/xml, example= + "status" : "aeiou", + "quantity" : 123, + "shipDate" : "2000-01-23T04:56:07.000+0000" +}, contentType=application/json}, {example= 123456 123456 0 2000-01-23T04:56:07.000Z string true -}] - - examples: [{contentType=application/json, example={ - "petId" : 123456789, - "quantity" : 123, +, contentType=application/xml}] + - examples: [{example={ "id" : 123456789, - "shipDate" : "2000-01-23T04:56:07.000+0000", + "petId" : 123456789, "complete" : true, - "status" : "aeiou" -}}, {contentType=application/xml, example= + "status" : "aeiou", + "quantity" : 123, + "shipDate" : "2000-01-23T04:56:07.000+0000" +}, contentType=application/json}, {example= 123456 123456 0 2000-01-23T04:56:07.000Z string true -}] +, contentType=application/xml}] - parameter body: (body) order placed for purchasing the pet (optional) diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift index 6a522eb8813..62018cd83c2 100644 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift @@ -192,9 +192,6 @@ public class UserAPI: APIBase { Delete user - DELETE /user/{username} - This can only be done by the logged in user. - - BASIC: - - type: basic - - name: test_http_basic - parameter username: (path) The name that needs to be deleted @@ -247,16 +244,44 @@ public class UserAPI: APIBase { Get user by user name - GET /user/{username} - - - examples: [{contentType=application/json, example={ - "id" : 1, - "username" : "johnp", - "firstName" : "John", - "lastName" : "Public", - "email" : "johnp@swagger.io", - "password" : "-secret-", - "phone" : "0123456789", - "userStatus" : 0 -}}] + - examples: [{example={ + "id" : 123456789, + "lastName" : "aeiou", + "phone" : "aeiou", + "username" : "aeiou", + "email" : "aeiou", + "userStatus" : 123, + "firstName" : "aeiou", + "password" : "aeiou" +}, contentType=application/json}, {example= + 123456 + string + string + string + string + string + string + 0 +, contentType=application/xml}] + - examples: [{example={ + "id" : 123456789, + "lastName" : "aeiou", + "phone" : "aeiou", + "username" : "aeiou", + "email" : "aeiou", + "userStatus" : 123, + "firstName" : "aeiou", + "password" : "aeiou" +}, contentType=application/json}, {example= + 123456 + string + string + string + string + string + string + 0 +, contentType=application/xml}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. @@ -311,8 +336,8 @@ public class UserAPI: APIBase { Logs user into the system - GET /user/login - - - examples: [{contentType=application/json, example="aeiou"}, {contentType=application/xml, example=string}] - - examples: [{contentType=application/json, example="aeiou"}, {contentType=application/xml, example=string}] + - examples: [{example="aeiou", contentType=application/json}, {example=string, contentType=application/xml}] + - examples: [{example="aeiou", contentType=application/json}, {example=string, contentType=application/xml}] - parameter username: (query) The user name for login (optional) - parameter password: (query) The password for login in clear text (optional) diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift index 6b4d36f9410..2faa0a6f24d 100644 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift @@ -75,7 +75,7 @@ class AlamofireRequestBuilder: RequestBuilder { request.authenticate(usingCredential: credential) } - request.responseJSON(options: .AllowFragments) { response in + request.validate().responseJSON(options: .AllowFragments) { response in managerStore.removeValueForKey(managerId) if response.result.isFailure { diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models.swift index 3d3710ea223..f9e2f72b908 100644 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models.swift +++ b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models.swift @@ -130,33 +130,6 @@ class Decoders { fatalError("formatter failed to parse \(source)") } - // Decoder for [Animal] - Decoders.addDecoder(clazz: [Animal].self) { (source: AnyObject) -> [Animal] in - return Decoders.decode(clazz: [Animal].self, source: source) - } - // Decoder for Animal - Decoders.addDecoder(clazz: Animal.self) { (source: AnyObject) -> Animal in - let sourceDictionary = source as! [NSObject:AnyObject] - let instance = Animal() - instance.className = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"]) - return instance - } - - - // Decoder for [Cat] - Decoders.addDecoder(clazz: [Cat].self) { (source: AnyObject) -> [Cat] in - return Decoders.decode(clazz: [Cat].self, source: source) - } - // Decoder for Cat - Decoders.addDecoder(clazz: Cat.self) { (source: AnyObject) -> Cat in - let sourceDictionary = source as! [NSObject:AnyObject] - let instance = Cat() - instance.className = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"]) - instance.declawed = Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"]) - return instance - } - - // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject) -> [Category] in return Decoders.decode(clazz: [Category].self, source: source) @@ -171,102 +144,6 @@ class Decoders { } - // Decoder for [Dog] - Decoders.addDecoder(clazz: [Dog].self) { (source: AnyObject) -> [Dog] in - return Decoders.decode(clazz: [Dog].self, source: source) - } - // Decoder for Dog - Decoders.addDecoder(clazz: Dog.self) { (source: AnyObject) -> Dog in - let sourceDictionary = source as! [NSObject:AnyObject] - let instance = Dog() - instance.className = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"]) - instance.breed = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"]) - return instance - } - - - // Decoder for [FormatTest] - Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject) -> [FormatTest] in - return Decoders.decode(clazz: [FormatTest].self, source: source) - } - // Decoder for FormatTest - Decoders.addDecoder(clazz: FormatTest.self) { (source: AnyObject) -> FormatTest in - let sourceDictionary = source as! [NSObject:AnyObject] - let instance = FormatTest() - instance.integer = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer"]) - instance._int32 = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["int32"]) - instance._int64 = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["int64"]) - instance.number = Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number"]) - instance._float = Decoders.decodeOptional(clazz: Float.self, source: sourceDictionary["float"]) - instance._double = Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["double"]) - instance._string = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string"]) - instance.byte = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["byte"]) - instance.binary = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["binary"]) - instance.date = Decoders.decodeOptional(clazz: NSDate.self, source: sourceDictionary["date"]) - instance.dateTime = Decoders.decodeOptional(clazz: NSDate.self, source: sourceDictionary["dateTime"]) - instance.password = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["password"]) - return instance - } - - - // Decoder for [InlineResponse200] - Decoders.addDecoder(clazz: [InlineResponse200].self) { (source: AnyObject) -> [InlineResponse200] in - return Decoders.decode(clazz: [InlineResponse200].self, source: source) - } - // Decoder for InlineResponse200 - Decoders.addDecoder(clazz: InlineResponse200.self) { (source: AnyObject) -> InlineResponse200 in - let sourceDictionary = source as! [NSObject:AnyObject] - let instance = InlineResponse200() - instance.photoUrls = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["photoUrls"]) - instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) - instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) - instance.category = Decoders.decodeOptional(clazz: AnyObject.self, source: sourceDictionary["category"]) - instance.tags = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["tags"]) - instance.status = InlineResponse200.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") - return instance - } - - - // Decoder for [Model200Response] - Decoders.addDecoder(clazz: [Model200Response].self) { (source: AnyObject) -> [Model200Response] in - return Decoders.decode(clazz: [Model200Response].self, source: source) - } - // Decoder for Model200Response - Decoders.addDecoder(clazz: Model200Response.self) { (source: AnyObject) -> Model200Response in - let sourceDictionary = source as! [NSObject:AnyObject] - let instance = Model200Response() - instance.name = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["name"]) - return instance - } - - - // Decoder for [ModelReturn] - Decoders.addDecoder(clazz: [ModelReturn].self) { (source: AnyObject) -> [ModelReturn] in - return Decoders.decode(clazz: [ModelReturn].self, source: source) - } - // Decoder for ModelReturn - Decoders.addDecoder(clazz: ModelReturn.self) { (source: AnyObject) -> ModelReturn in - let sourceDictionary = source as! [NSObject:AnyObject] - let instance = ModelReturn() - instance._return = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["return"]) - return instance - } - - - // Decoder for [Name] - Decoders.addDecoder(clazz: [Name].self) { (source: AnyObject) -> [Name] in - return Decoders.decode(clazz: [Name].self, source: source) - } - // Decoder for Name - Decoders.addDecoder(clazz: Name.self) { (source: AnyObject) -> Name in - let sourceDictionary = source as! [NSObject:AnyObject] - let instance = Name() - instance.name = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["name"]) - instance.snakeCase = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["snake_case"]) - return instance - } - - // Decoder for [Order] Decoders.addDecoder(clazz: [Order].self) { (source: AnyObject) -> [Order] in return Decoders.decode(clazz: [Order].self, source: source) @@ -303,19 +180,6 @@ class Decoders { } - // Decoder for [SpecialModelName] - Decoders.addDecoder(clazz: [SpecialModelName].self) { (source: AnyObject) -> [SpecialModelName] in - return Decoders.decode(clazz: [SpecialModelName].self, source: source) - } - // Decoder for SpecialModelName - Decoders.addDecoder(clazz: SpecialModelName.self) { (source: AnyObject) -> SpecialModelName in - let sourceDictionary = source as! [NSObject:AnyObject] - let instance = SpecialModelName() - instance.specialPropertyName = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["$special[property.name]"]) - return instance - } - - // Decoder for [Tag] Decoders.addDecoder(clazz: [Tag].self) { (source: AnyObject) -> [Tag] in return Decoders.decode(clazz: [Tag].self, source: source) diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Animal.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Animal.swift deleted file mode 100644 index 586b10f5931..00000000000 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Animal.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// Animal.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -public class Animal: JSONEncodable { - public var className: String? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() - nillableDictionary["className"] = self.className - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Cat.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Cat.swift deleted file mode 100644 index bdf66b563d2..00000000000 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Cat.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// Cat.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -public class Cat: JSONEncodable { - public var className: String? - public var declawed: Bool? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() - nillableDictionary["className"] = self.className - nillableDictionary["declawed"] = self.declawed - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Dog.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Dog.swift deleted file mode 100644 index 8a1fafdfc67..00000000000 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Dog.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// Dog.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -public class Dog: JSONEncodable { - public var className: String? - public var breed: String? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() - nillableDictionary["className"] = self.className - nillableDictionary["breed"] = self.breed - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift deleted file mode 100644 index b84000125e3..00000000000 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// FormatTest.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -public 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: String? - public var binary: String? - public var date: NSDate? - public var dateTime: NSDate? - public var password: String? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() - nillableDictionary["integer"] = self.integer?.encodeToJSON() - nillableDictionary["int32"] = self._int32?.encodeToJSON() - nillableDictionary["int64"] = self._int64?.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 - nillableDictionary["binary"] = self.binary - nillableDictionary["date"] = self.date?.encodeToJSON() - nillableDictionary["dateTime"] = self.dateTime?.encodeToJSON() - nillableDictionary["password"] = self.password - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/InlineResponse200.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/InlineResponse200.swift deleted file mode 100644 index a9397e868ba..00000000000 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/InlineResponse200.swift +++ /dev/null @@ -1,40 +0,0 @@ -// -// InlineResponse200.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -public class InlineResponse200: JSONEncodable { - public enum Status: String { - case Available = "available" - case Pending = "pending" - case Sold = "sold" - } - public var photoUrls: [String]? - public var name: String? - public var id: Int64? - public var category: AnyObject? - 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["photoUrls"] = self.photoUrls?.encodeToJSON() - nillableDictionary["name"] = self.name - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["category"] = self.category - 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/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift deleted file mode 100644 index 43cc68a5c2d..00000000000 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// Model200Response.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -/** Model for testing model name starting with number */ -public class Model200Response: JSONEncodable { - public var name: Int32? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() - nillableDictionary["name"] = self.name?.encodeToJSON() - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/ModelReturn.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/ModelReturn.swift deleted file mode 100644 index 80e2ef13b24..00000000000 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/ModelReturn.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// ModelReturn.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -/** Model for testing reserved words */ -public class ModelReturn: JSONEncodable { - public var _return: Int32? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() - nillableDictionary["return"] = self._return?.encodeToJSON() - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Name.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Name.swift deleted file mode 100644 index a0e40281d45..00000000000 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/Name.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Name.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -/** Model for testing model name same as property name */ -public class Name: JSONEncodable { - public var name: Int32? - public var snakeCase: Int32? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() - nillableDictionary["name"] = self.name?.encodeToJSON() - nillableDictionary["snake_case"] = self.snakeCase?.encodeToJSON() - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/ObjectReturn.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/ObjectReturn.swift deleted file mode 100644 index 85985274ef4..00000000000 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/ObjectReturn.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// ObjectReturn.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -public class ObjectReturn: JSONEncodable { - - public var _return: Int? - - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() - nillableDictionary["_return"] = self._return - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift deleted file mode 100644 index cb92fbd2f78..00000000000 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// SpecialModelName.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -public class SpecialModelName: JSONEncodable { - public var specialPropertyName: Int64? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() - nillableDictionary["$special[property.name]"] = self.specialPropertyName?.encodeToJSON() - nillableDictionary["$special[property.name]"] = self.specialPropertyName?.encodeToJSON() - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -}