Fix issue #6212 POD Generated podfile doesn't include all generated swift files #6212 (#6220)

* Reference all generated swift files in the podfile

* Update test files
This commit is contained in:
Hans-Christian Esperer 2017-08-03 18:46:01 +02:00 committed by wing328
parent 9cadfd45d7
commit 3cb36738b1
121 changed files with 1080 additions and 86 deletions

View File

@ -25,7 +25,7 @@ Pod::Spec.new do |s|
{{#podDocumentationURL}}
s.documentation_url = '{{podDocumentationURL}}'
{{/podDocumentationURL}}
s.source_files = '{{projectName}}/Classes/Swaggers/**/*.swift'
s.source_files = '{{projectName}}/Classes/**/*.swift'
{{#usePromiseKit}}
s.dependency 'PromiseKit', '~> 3.5.3'
{{/usePromiseKit}}

View File

@ -14,7 +14,7 @@ Pod::Spec.new do |s|
s.description = '{{podDescription}}'{{/podDescription}}{{#podScreenshots}}
s.screenshots = {{& podScreenshots}}{{/podScreenshots}}{{#podDocumentationURL}}
s.documentation_url = '{{podDocumentationURL}}'{{/podDocumentationURL}}
s.source_files = '{{projectName}}/Classes/Swaggers/**/*.swift'{{#usePromiseKit}}
s.source_files = '{{projectName}}/Classes/**/*.swift'{{#usePromiseKit}}
s.dependency 'PromiseKit', '~> 4.2.2'{{/usePromiseKit}}{{#useRxSwift}}
s.dependency 'RxSwift', '~> 3.4.1'{{/useRxSwift}}
s.dependency 'Alamofire', '~> 4.0'

View File

@ -14,7 +14,7 @@ Pod::Spec.new do |s|
s.description = '{{podDescription}}'{{/podDescription}}{{#podScreenshots}}
s.screenshots = {{& podScreenshots}}{{/podScreenshots}}{{#podDocumentationURL}}
s.documentation_url = '{{podDocumentationURL}}'{{/podDocumentationURL}}
s.source_files = '{{projectName}}/Classes/Swaggers/**/*.swift'{{#usePromiseKit}}
s.source_files = '{{projectName}}/Classes/**/*.swift'{{#usePromiseKit}}
s.dependency 'PromiseKit', '~> 4.2.2'{{/usePromiseKit}}{{#useRxSwift}}
s.dependency 'RxSwift', '~> 3.4.1'{{/useRxSwift}}
s.dependency 'Alamofire', '~> 4.5'

View File

@ -8,6 +8,6 @@ Pod::Spec.new do |s|
s.license = 'Proprietary'
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
s.summary = 'PetstoreClient'
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
s.source_files = 'PetstoreClient/Classes/**/*.swift'
s.dependency 'Alamofire', '~> 3.5.1'
end

View File

@ -8,7 +8,7 @@ Pod::Spec.new do |s|
s.license = 'Proprietary'
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
s.summary = 'PetstoreClient'
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
s.source_files = 'PetstoreClient/Classes/**/*.swift'
s.dependency 'PromiseKit', '~> 3.5.3'
s.dependency 'Alamofire', '~> 3.5.1'
end

View File

@ -8,7 +8,7 @@ Pod::Spec.new do |s|
s.license = 'Proprietary'
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
s.summary = 'PetstoreClient'
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
s.source_files = 'PetstoreClient/Classes/**/*.swift'
s.dependency 'RxSwift', '~> 2.6.1'
s.dependency 'Alamofire', '~> 3.5.1'
end

View File

@ -8,6 +8,6 @@ Pod::Spec.new do |s|
s.license = 'Proprietary'
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
s.summary = 'PetstoreClient'
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
s.source_files = 'PetstoreClient/Classes/**/*.swift'
s.dependency 'Alamofire', '~> 4.0'
end

View File

@ -8,7 +8,7 @@ Pod::Spec.new do |s|
s.license = 'Proprietary'
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
s.summary = 'PetstoreClient'
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
s.source_files = 'PetstoreClient/Classes/**/*.swift'
s.dependency 'PromiseKit', '~> 4.2.2'
s.dependency 'Alamofire', '~> 4.0'
end

View File

@ -8,7 +8,7 @@ Pod::Spec.new do |s|
s.license = 'Proprietary'
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
s.summary = 'PetstoreClient'
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
s.source_files = 'PetstoreClient/Classes/**/*.swift'
s.dependency 'RxSwift', '~> 3.4.1'
s.dependency 'Alamofire', '~> 4.0'
end

View File

@ -8,6 +8,6 @@ Pod::Spec.new do |s|
s.license = 'Proprietary'
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
s.summary = 'PetstoreClient'
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
s.source_files = 'PetstoreClient/Classes/**/*.swift'
s.dependency 'Alamofire', '~> 4.0'
end

View File

@ -1 +1 @@
2.2.3-SNAPSHOT
2.3.0-SNAPSHOT

View File

@ -8,6 +8,6 @@ Pod::Spec.new do |s|
s.license = 'Proprietary'
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
s.summary = 'PetstoreClient'
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
s.source_files = 'PetstoreClient/Classes/**/*.swift'
s.dependency 'Alamofire', '~> 4.5'
end

View File

@ -208,7 +208,7 @@ open class FakeAPI {
- 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: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: Error?) -> Void)) {
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: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ 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 { (response, error) -> Void in
completion(error);
}
@ -240,7 +240,7 @@ open class FakeAPI {
- returns: RequestBuilder<Void>
*/
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: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder<Void> {
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: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder<Void> {
let path = "/fake"
let URLString = PetstoreClientAPI.basePath + path
let formParams: [String:Any?] = [
@ -325,7 +325,7 @@ open class FakeAPI {
/**
* enum for parameter enumQueryInteger
*/
public enum EnumQueryInteger_testEnumParameters: Int32 {
public enum EnumQueryInteger_testEnumParameters: Int {
case _1 = 1
case numberminus2 = -2
}
@ -404,4 +404,47 @@ open class FakeAPI {
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: Error?) -> 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<Void>
*/
open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder<Void> {
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 = NSURLComponents(string: URLString)
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
}
}

View File

@ -0,0 +1,54 @@
//
// Fake_classname_tags123API.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
//
import Foundation
import Alamofire
open class Fake_classname_tags123API {
/**
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
- API Key:
- type: apiKey api_key_query (QUERY)
- name: api_key_query
- examples: [{contentType=application/json, example={
"client" : "aeiou"
}}]
- parameter body: (body) client model
- returns: RequestBuilder<Client>
*/
open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder<Client> {
let path = "/fake_classname_test"
let URLString = PetstoreClientAPI.basePath + path
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
let url = NSURLComponents(string: URLString)
let requestBuilder: RequestBuilder<Client>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true)
}
}

View File

@ -52,7 +52,7 @@ open class StoreAPI {
- parameter completion: completion handler to receive the data and the error objects
*/
open class func getInventory(completion: @escaping ((_ data: [String:Int32]?,_ error: Error?) -> Void)) {
open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) {
getInventoryWithRequestBuilder().execute { (response, error) -> Void in
completion(response?.body, error);
}
@ -70,9 +70,9 @@ open class StoreAPI {
"key" : 0
}}]
- returns: RequestBuilder<[String:Int32]>
- returns: RequestBuilder<[String:Int]>
*/
open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> {
open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> {
let path = "/store/inventory"
let URLString = PetstoreClientAPI.basePath + path
let parameters: [String:Any]? = nil
@ -80,7 +80,7 @@ open class StoreAPI {
let url = NSURLComponents(string: URLString)
let requestBuilder: RequestBuilder<[String:Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
}

View File

@ -244,8 +244,8 @@ open class UserAPI {
Logs user into the system
- GET /user/login
-
- responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)]
- responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)]
- responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)]
- responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)]
- examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}]
- examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}]

View File

@ -35,7 +35,9 @@ open class CodableHelper {
var returnedError: Error? = nil
let encoder = JSONEncoder()
encoder.outputFormatting = (prettyPrint ? .prettyPrinted : .compact)
if prettyPrint {
encoder.outputFormatting = .prettyPrinted
}
encoder.dataEncodingStrategy = .base64Encode
if #available(iOS 10.0, *) {
encoder.dateEncodingStrategy = .iso8601

View File

@ -15,4 +15,10 @@ open class AdditionalPropertiesClass: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case mapProperty = "map_property"
case mapOfMapProperty = "map_of_map_property"
}
}

View File

@ -15,4 +15,10 @@ open class Animal: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case className = "className"
case color = "color"
}
}

View File

@ -10,10 +10,17 @@ import Foundation
open class ApiResponse: Codable {
public var code: Int32?
public var code: Int?
public var type: String?
public var message: String?
public init() {}
private enum CodingKeys: String, CodingKey {
case code = "code"
case type = "type"
case message = "message"
}
}

View File

@ -14,4 +14,9 @@ open class ArrayOfArrayOfNumberOnly: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case arrayArrayNumber = "ArrayArrayNumber"
}
}

View File

@ -14,4 +14,9 @@ open class ArrayOfNumberOnly: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case arrayNumber = "ArrayNumber"
}
}

View File

@ -16,4 +16,11 @@ open class ArrayTest: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case arrayOfString = "array_of_string"
case arrayArrayOfInteger = "array_array_of_integer"
case arrayArrayOfModel = "array_array_of_model"
}
}

View File

@ -20,4 +20,14 @@ open class Capitalization: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case smallCamel = "smallCamel"
case capitalCamel = "CapitalCamel"
case smallSnake = "small_Snake"
case capitalSnake = "Capital_Snake"
case sCAETHFlowPoints = "SCA_ETH_Flow_Points"
case ATT_NAME = "ATT_NAME"
}
}

View File

@ -14,4 +14,9 @@ open class Cat: Animal {
private enum CodingKeys: String, CodingKey {
case declawed = "declawed"
}
}

View File

@ -15,4 +15,10 @@ open class Category: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case id = "id"
case name = "name"
}
}

View File

@ -15,4 +15,9 @@ open class ClassModel: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case _class = "_class"
}
}

View File

@ -14,4 +14,9 @@ open class Client: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case client = "client"
}
}

View File

@ -14,4 +14,9 @@ open class Dog: Animal {
private enum CodingKeys: String, CodingKey {
case breed = "breed"
}
}

View File

@ -23,4 +23,10 @@ open class EnumArrays: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case justSymbol = "just_symbol"
case arrayEnum = "array_enum"
}
}

View File

@ -15,7 +15,7 @@ open class EnumTest: Codable {
case lower = "lower"
case empty = ""
}
public enum EnumInteger: Int32, Codable {
public enum EnumInteger: Int, Codable {
case _1 = 1
case numberminus1 = -1
}
@ -30,4 +30,12 @@ open class EnumTest: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case enumString = "enum_string"
case enumInteger = "enum_integer"
case enumNumber = "enum_number"
case outerEnum = "outerEnum"
}
}

View File

@ -10,8 +10,8 @@ import Foundation
open class FormatTest: Codable {
public var integer: Int32?
public var int32: Int32?
public var integer: Int?
public var int32: Int?
public var int64: Int64?
public var number: Double?
public var float: Float?
@ -26,4 +26,21 @@ open class FormatTest: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case integer = "integer"
case int32 = "int32"
case int64 = "int64"
case number = "number"
case float = "float"
case double = "double"
case string = "string"
case byte = "byte"
case binary = "binary"
case date = "date"
case dateTime = "dateTime"
case uuid = "uuid"
case password = "password"
}
}

View File

@ -15,4 +15,10 @@ open class HasOnlyReadOnly: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case bar = "bar"
case foo = "foo"
}
}

View File

@ -14,4 +14,9 @@ open class List: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case _123List = "123-list"
}
}

View File

@ -19,4 +19,10 @@ open class MapTest: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case mapMapOfString = "map_map_of_string"
case mapOfEnumString = "map_of_enum_string"
}
}

View File

@ -16,4 +16,11 @@ open class MixedPropertiesAndAdditionalPropertiesClass: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case uuid = "uuid"
case dateTime = "dateTime"
case map = "map"
}
}

View File

@ -11,9 +11,15 @@ import Foundation
/** Model for testing model name starting with number */
open class Model200Response: Codable {
public var name: Int32?
public var name: Int?
public var _class: String?
public init() {}
private enum CodingKeys: String, CodingKey {
case name = "name"
case _class = "class"
}
}

View File

@ -11,11 +11,19 @@ import Foundation
/** Model for testing model name same as property name */
open class Name: Codable {
public var name: Int32?
public var snakeCase: Int32?
public var name: Int?
public var snakeCase: Int?
public var property: String?
public var _123Number: Int32?
public var _123Number: Int?
public init() {}
private enum CodingKeys: String, CodingKey {
case name = "name"
case snakeCase = "snake_case"
case property = "property"
case _123Number = "123Number"
}
}

View File

@ -14,4 +14,9 @@ open class NumberOnly: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case justNumber = "JustNumber"
}
}

View File

@ -17,7 +17,7 @@ open class Order: Codable {
}
public var id: Int64?
public var petId: Int64?
public var quantity: Int32?
public var quantity: Int?
public var shipDate: Date?
/** Order Status */
public var status: Status?
@ -25,4 +25,14 @@ open class Order: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case id = "id"
case petId = "petId"
case quantity = "quantity"
case shipDate = "shipDate"
case status = "status"
case complete = "complete"
}
}

View File

@ -16,4 +16,11 @@ open class OuterComposite: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case myNumber = "my_number"
case myString = "my_string"
case myBoolean = "my_boolean"
}
}

View File

@ -25,4 +25,14 @@ open class Pet: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case id = "id"
case category = "category"
case name = "name"
case photoUrls = "photoUrls"
case tags = "tags"
case status = "status"
}
}

View File

@ -15,4 +15,10 @@ open class ReadOnlyFirst: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case bar = "bar"
case baz = "baz"
}
}

View File

@ -11,8 +11,13 @@ import Foundation
/** Model for testing reserved words */
open class Return: Codable {
public var _return: Int32?
public var _return: Int?
public init() {}
private enum CodingKeys: String, CodingKey {
case _return = "return"
}
}

View File

@ -14,4 +14,9 @@ open class SpecialModelName: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case specialPropertyName = "$special[property.name]"
}
}

View File

@ -15,4 +15,10 @@ open class Tag: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case id = "id"
case name = "name"
}
}

View File

@ -18,8 +18,20 @@ open class User: Codable {
public var password: String?
public var phone: String?
/** User Status */
public var userStatus: Int32?
public var userStatus: Int?
public init() {}
private enum CodingKeys: String, CodingKey {
case id = "id"
case username = "username"
case firstName = "firstName"
case lastName = "lastName"
case email = "email"
case password = "password"
case phone = "phone"
case userStatus = "userStatus"
}
}

View File

@ -1 +1 @@
2.2.3-SNAPSHOT
2.3.0-SNAPSHOT

View File

@ -8,7 +8,7 @@ Pod::Spec.new do |s|
s.license = 'Proprietary'
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
s.summary = 'PetstoreClient'
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
s.source_files = 'PetstoreClient/Classes/**/*.swift'
s.dependency 'PromiseKit', '~> 4.2.2'
s.dependency 'Alamofire', '~> 4.5'
end

View File

@ -290,7 +290,7 @@ open class FakeAPI {
- 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: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: Error?) -> Void)) {
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: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ 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 { (response, error) -> Void in
completion(error);
}
@ -315,7 +315,7 @@ open class FakeAPI {
- parameter callback: (form) None (optional)
- returns: Promise<Void>
*/
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: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Promise<Void> {
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: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Promise<Void> {
let deferred = Promise<Void>.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 {
@ -352,7 +352,7 @@ open class FakeAPI {
- returns: RequestBuilder<Void>
*/
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: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder<Void> {
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: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder<Void> {
let path = "/fake"
let URLString = PetstoreClientAPI.basePath + path
let formParams: [String:Any?] = [
@ -437,7 +437,7 @@ open class FakeAPI {
/**
* enum for parameter enumQueryInteger
*/
public enum EnumQueryInteger_testEnumParameters: Int32 {
public enum EnumQueryInteger_testEnumParameters: Int {
case _1 = 1
case numberminus2 = -2
}
@ -540,4 +540,65 @@ open class FakeAPI {
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: Error?) -> 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<Void>
*/
open class func testJsonFormData( param: String, param2: String) -> Promise<Void> {
let deferred = Promise<Void>.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<Void>
*/
open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder<Void> {
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 = NSURLComponents(string: URLString)
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
}
}

View File

@ -0,0 +1,72 @@
//
// Fake_classname_tags123API.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
//
import Foundation
import Alamofire
import PromiseKit
open class Fake_classname_tags123API {
/**
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
- returns: Promise<Client>
*/
open class func testClassname( body: Client) -> Promise<Client> {
let deferred = Promise<Client>.pending()
testClassname(body: body) { 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
- API Key:
- type: apiKey api_key_query (QUERY)
- name: api_key_query
- examples: [{contentType=application/json, example={
"client" : "aeiou"
}}]
- parameter body: (body) client model
- returns: RequestBuilder<Client>
*/
open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder<Client> {
let path = "/fake_classname_test"
let URLString = PetstoreClientAPI.basePath + path
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
let url = NSURLComponents(string: URLString)
let requestBuilder: RequestBuilder<Client>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true)
}
}

View File

@ -70,7 +70,7 @@ open class StoreAPI {
- parameter completion: completion handler to receive the data and the error objects
*/
open class func getInventory(completion: @escaping ((_ data: [String:Int32]?,_ error: Error?) -> Void)) {
open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) {
getInventoryWithRequestBuilder().execute { (response, error) -> Void in
completion(response?.body, error);
}
@ -79,10 +79,10 @@ open class StoreAPI {
/**
Returns pet inventories by status
- returns: Promise<[String:Int32]>
- returns: Promise<[String:Int]>
*/
open class func getInventory() -> Promise<[String:Int32]> {
let deferred = Promise<[String:Int32]>.pending()
open class func getInventory() -> Promise<[String:Int]> {
let deferred = Promise<[String:Int]>.pending()
getInventory() { data, error in
if let error = error {
deferred.reject(error)
@ -104,9 +104,9 @@ open class StoreAPI {
"key" : 0
}}]
- returns: RequestBuilder<[String:Int32]>
- returns: RequestBuilder<[String:Int]>
*/
open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> {
open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> {
let path = "/store/inventory"
let URLString = PetstoreClientAPI.basePath + path
let parameters: [String:Any]? = nil
@ -114,7 +114,7 @@ open class StoreAPI {
let url = NSURLComponents(string: URLString)
let requestBuilder: RequestBuilder<[String:Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
}

View File

@ -348,8 +348,8 @@ open class UserAPI {
Logs user into the system
- GET /user/login
-
- responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)]
- responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)]
- responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)]
- responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)]
- examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}]
- examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}]

View File

@ -35,7 +35,9 @@ open class CodableHelper {
var returnedError: Error? = nil
let encoder = JSONEncoder()
encoder.outputFormatting = (prettyPrint ? .prettyPrinted : .compact)
if prettyPrint {
encoder.outputFormatting = .prettyPrinted
}
encoder.dataEncodingStrategy = .base64Encode
if #available(iOS 10.0, *) {
encoder.dateEncodingStrategy = .iso8601

View File

@ -15,4 +15,10 @@ open class AdditionalPropertiesClass: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case mapProperty = "map_property"
case mapOfMapProperty = "map_of_map_property"
}
}

View File

@ -15,4 +15,10 @@ open class Animal: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case className = "className"
case color = "color"
}
}

View File

@ -10,10 +10,17 @@ import Foundation
open class ApiResponse: Codable {
public var code: Int32?
public var code: Int?
public var type: String?
public var message: String?
public init() {}
private enum CodingKeys: String, CodingKey {
case code = "code"
case type = "type"
case message = "message"
}
}

View File

@ -14,4 +14,9 @@ open class ArrayOfArrayOfNumberOnly: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case arrayArrayNumber = "ArrayArrayNumber"
}
}

View File

@ -14,4 +14,9 @@ open class ArrayOfNumberOnly: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case arrayNumber = "ArrayNumber"
}
}

View File

@ -16,4 +16,11 @@ open class ArrayTest: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case arrayOfString = "array_of_string"
case arrayArrayOfInteger = "array_array_of_integer"
case arrayArrayOfModel = "array_array_of_model"
}
}

View File

@ -20,4 +20,14 @@ open class Capitalization: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case smallCamel = "smallCamel"
case capitalCamel = "CapitalCamel"
case smallSnake = "small_Snake"
case capitalSnake = "Capital_Snake"
case sCAETHFlowPoints = "SCA_ETH_Flow_Points"
case ATT_NAME = "ATT_NAME"
}
}

View File

@ -14,4 +14,9 @@ open class Cat: Animal {
private enum CodingKeys: String, CodingKey {
case declawed = "declawed"
}
}

View File

@ -15,4 +15,10 @@ open class Category: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case id = "id"
case name = "name"
}
}

View File

@ -15,4 +15,9 @@ open class ClassModel: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case _class = "_class"
}
}

View File

@ -14,4 +14,9 @@ open class Client: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case client = "client"
}
}

View File

@ -14,4 +14,9 @@ open class Dog: Animal {
private enum CodingKeys: String, CodingKey {
case breed = "breed"
}
}

View File

@ -23,4 +23,10 @@ open class EnumArrays: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case justSymbol = "just_symbol"
case arrayEnum = "array_enum"
}
}

View File

@ -15,7 +15,7 @@ open class EnumTest: Codable {
case lower = "lower"
case empty = ""
}
public enum EnumInteger: Int32, Codable {
public enum EnumInteger: Int, Codable {
case _1 = 1
case numberminus1 = -1
}
@ -30,4 +30,12 @@ open class EnumTest: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case enumString = "enum_string"
case enumInteger = "enum_integer"
case enumNumber = "enum_number"
case outerEnum = "outerEnum"
}
}

View File

@ -10,8 +10,8 @@ import Foundation
open class FormatTest: Codable {
public var integer: Int32?
public var int32: Int32?
public var integer: Int?
public var int32: Int?
public var int64: Int64?
public var number: Double?
public var float: Float?
@ -26,4 +26,21 @@ open class FormatTest: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case integer = "integer"
case int32 = "int32"
case int64 = "int64"
case number = "number"
case float = "float"
case double = "double"
case string = "string"
case byte = "byte"
case binary = "binary"
case date = "date"
case dateTime = "dateTime"
case uuid = "uuid"
case password = "password"
}
}

View File

@ -15,4 +15,10 @@ open class HasOnlyReadOnly: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case bar = "bar"
case foo = "foo"
}
}

View File

@ -14,4 +14,9 @@ open class List: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case _123List = "123-list"
}
}

View File

@ -19,4 +19,10 @@ open class MapTest: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case mapMapOfString = "map_map_of_string"
case mapOfEnumString = "map_of_enum_string"
}
}

View File

@ -16,4 +16,11 @@ open class MixedPropertiesAndAdditionalPropertiesClass: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case uuid = "uuid"
case dateTime = "dateTime"
case map = "map"
}
}

View File

@ -11,9 +11,15 @@ import Foundation
/** Model for testing model name starting with number */
open class Model200Response: Codable {
public var name: Int32?
public var name: Int?
public var _class: String?
public init() {}
private enum CodingKeys: String, CodingKey {
case name = "name"
case _class = "class"
}
}

View File

@ -11,11 +11,19 @@ import Foundation
/** Model for testing model name same as property name */
open class Name: Codable {
public var name: Int32?
public var snakeCase: Int32?
public var name: Int?
public var snakeCase: Int?
public var property: String?
public var _123Number: Int32?
public var _123Number: Int?
public init() {}
private enum CodingKeys: String, CodingKey {
case name = "name"
case snakeCase = "snake_case"
case property = "property"
case _123Number = "123Number"
}
}

View File

@ -14,4 +14,9 @@ open class NumberOnly: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case justNumber = "JustNumber"
}
}

View File

@ -17,7 +17,7 @@ open class Order: Codable {
}
public var id: Int64?
public var petId: Int64?
public var quantity: Int32?
public var quantity: Int?
public var shipDate: Date?
/** Order Status */
public var status: Status?
@ -25,4 +25,14 @@ open class Order: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case id = "id"
case petId = "petId"
case quantity = "quantity"
case shipDate = "shipDate"
case status = "status"
case complete = "complete"
}
}

View File

@ -16,4 +16,11 @@ open class OuterComposite: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case myNumber = "my_number"
case myString = "my_string"
case myBoolean = "my_boolean"
}
}

View File

@ -25,4 +25,14 @@ open class Pet: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case id = "id"
case category = "category"
case name = "name"
case photoUrls = "photoUrls"
case tags = "tags"
case status = "status"
}
}

View File

@ -15,4 +15,10 @@ open class ReadOnlyFirst: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case bar = "bar"
case baz = "baz"
}
}

View File

@ -11,8 +11,13 @@ import Foundation
/** Model for testing reserved words */
open class Return: Codable {
public var _return: Int32?
public var _return: Int?
public init() {}
private enum CodingKeys: String, CodingKey {
case _return = "return"
}
}

View File

@ -14,4 +14,9 @@ open class SpecialModelName: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case specialPropertyName = "$special[property.name]"
}
}

View File

@ -15,4 +15,10 @@ open class Tag: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case id = "id"
case name = "name"
}
}

View File

@ -18,8 +18,20 @@ open class User: Codable {
public var password: String?
public var phone: String?
/** User Status */
public var userStatus: Int32?
public var userStatus: Int?
public init() {}
private enum CodingKeys: String, CodingKey {
case id = "id"
case username = "username"
case firstName = "firstName"
case lastName = "lastName"
case email = "email"
case password = "password"
case phone = "phone"
case userStatus = "userStatus"
}
}

View File

@ -1 +1 @@
2.2.3-SNAPSHOT
2.3.0-SNAPSHOT

View File

@ -8,7 +8,7 @@ Pod::Spec.new do |s|
s.license = 'Proprietary'
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
s.summary = 'PetstoreClient'
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
s.source_files = 'PetstoreClient/Classes/**/*.swift'
s.dependency 'RxSwift', '~> 3.4.1'
s.dependency 'Alamofire', '~> 4.5'
end

View File

@ -300,7 +300,7 @@ open class FakeAPI {
- 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: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: Error?) -> Void)) {
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: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ 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 { (response, error) -> Void in
completion(error);
}
@ -325,7 +325,7 @@ open class FakeAPI {
- parameter callback: (form) None (optional)
- returns: Observable<Void>
*/
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: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Observable<Void> {
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: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Observable<Void> {
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 {
@ -364,7 +364,7 @@ open class FakeAPI {
- returns: RequestBuilder<Void>
*/
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: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder<Void> {
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: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder<Void> {
let path = "/fake"
let URLString = PetstoreClientAPI.basePath + path
let formParams: [String:Any?] = [
@ -449,7 +449,7 @@ open class FakeAPI {
/**
* enum for parameter enumQueryInteger
*/
public enum EnumQueryInteger_testEnumParameters: Int32 {
public enum EnumQueryInteger_testEnumParameters: Int {
case _1 = 1
case numberminus2 = -2
}
@ -554,4 +554,67 @@ open class FakeAPI {
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: Error?) -> 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<Void>
*/
open class func testJsonFormData(param: String, param2: String) -> Observable<Void> {
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<Void>
*/
open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder<Void> {
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 = NSURLComponents(string: URLString)
let requestBuilder: RequestBuilder<Void>.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder()
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
}
}

View File

@ -0,0 +1,74 @@
//
// Fake_classname_tags123API.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
//
import Foundation
import Alamofire
import RxSwift
open class Fake_classname_tags123API {
/**
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
- returns: Observable<Client>
*/
open class func testClassname(body: Client) -> Observable<Client> {
return Observable.create { observer -> Disposable in
testClassname(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()
}
}
/**
To test class name in snake case
- PATCH /fake_classname_test
- API Key:
- type: apiKey api_key_query (QUERY)
- name: api_key_query
- examples: [{contentType=application/json, example={
"client" : "aeiou"
}}]
- parameter body: (body) client model
- returns: RequestBuilder<Client>
*/
open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder<Client> {
let path = "/fake_classname_test"
let URLString = PetstoreClientAPI.basePath + path
let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body)
let url = NSURLComponents(string: URLString)
let requestBuilder: RequestBuilder<Client>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true)
}
}

View File

@ -72,7 +72,7 @@ open class StoreAPI {
- parameter completion: completion handler to receive the data and the error objects
*/
open class func getInventory(completion: @escaping ((_ data: [String:Int32]?,_ error: Error?) -> Void)) {
open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) {
getInventoryWithRequestBuilder().execute { (response, error) -> Void in
completion(response?.body, error);
}
@ -81,9 +81,9 @@ open class StoreAPI {
/**
Returns pet inventories by status
- returns: Observable<[String:Int32]>
- returns: Observable<[String:Int]>
*/
open class func getInventory() -> Observable<[String:Int32]> {
open class func getInventory() -> Observable<[String:Int]> {
return Observable.create { observer -> Disposable in
getInventory() { data, error in
if let error = error {
@ -108,9 +108,9 @@ open class StoreAPI {
"key" : 0
}}]
- returns: RequestBuilder<[String:Int32]>
- returns: RequestBuilder<[String:Int]>
*/
open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> {
open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> {
let path = "/store/inventory"
let URLString = PetstoreClientAPI.basePath + path
let parameters: [String:Any]? = nil
@ -118,7 +118,7 @@ open class StoreAPI {
let url = NSURLComponents(string: URLString)
let requestBuilder: RequestBuilder<[String:Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder()
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
}

View File

@ -360,8 +360,8 @@ open class UserAPI {
Logs user into the system
- GET /user/login
-
- responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)]
- responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)]
- responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)]
- responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)]
- examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}]
- examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}]

View File

@ -35,7 +35,9 @@ open class CodableHelper {
var returnedError: Error? = nil
let encoder = JSONEncoder()
encoder.outputFormatting = (prettyPrint ? .prettyPrinted : .compact)
if prettyPrint {
encoder.outputFormatting = .prettyPrinted
}
encoder.dataEncodingStrategy = .base64Encode
if #available(iOS 10.0, *) {
encoder.dateEncodingStrategy = .iso8601

View File

@ -15,4 +15,10 @@ open class AdditionalPropertiesClass: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case mapProperty = "map_property"
case mapOfMapProperty = "map_of_map_property"
}
}

View File

@ -15,4 +15,10 @@ open class Animal: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case className = "className"
case color = "color"
}
}

View File

@ -10,10 +10,17 @@ import Foundation
open class ApiResponse: Codable {
public var code: Int32?
public var code: Int?
public var type: String?
public var message: String?
public init() {}
private enum CodingKeys: String, CodingKey {
case code = "code"
case type = "type"
case message = "message"
}
}

View File

@ -14,4 +14,9 @@ open class ArrayOfArrayOfNumberOnly: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case arrayArrayNumber = "ArrayArrayNumber"
}
}

View File

@ -14,4 +14,9 @@ open class ArrayOfNumberOnly: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case arrayNumber = "ArrayNumber"
}
}

View File

@ -16,4 +16,11 @@ open class ArrayTest: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case arrayOfString = "array_of_string"
case arrayArrayOfInteger = "array_array_of_integer"
case arrayArrayOfModel = "array_array_of_model"
}
}

View File

@ -20,4 +20,14 @@ open class Capitalization: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case smallCamel = "smallCamel"
case capitalCamel = "CapitalCamel"
case smallSnake = "small_Snake"
case capitalSnake = "Capital_Snake"
case sCAETHFlowPoints = "SCA_ETH_Flow_Points"
case ATT_NAME = "ATT_NAME"
}
}

View File

@ -14,4 +14,9 @@ open class Cat: Animal {
private enum CodingKeys: String, CodingKey {
case declawed = "declawed"
}
}

View File

@ -15,4 +15,10 @@ open class Category: Codable {
public init() {}
private enum CodingKeys: String, CodingKey {
case id = "id"
case name = "name"
}
}

Some files were not shown because too many files have changed in this diff Show More