mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-06 15:40:54 +00:00
* Reference all generated swift files in the podfile * Update test files
This commit is contained in:
parent
9cadfd45d7
commit
3cb36738b1
@ -25,7 +25,7 @@ Pod::Spec.new do |s|
|
|||||||
{{#podDocumentationURL}}
|
{{#podDocumentationURL}}
|
||||||
s.documentation_url = '{{podDocumentationURL}}'
|
s.documentation_url = '{{podDocumentationURL}}'
|
||||||
{{/podDocumentationURL}}
|
{{/podDocumentationURL}}
|
||||||
s.source_files = '{{projectName}}/Classes/Swaggers/**/*.swift'
|
s.source_files = '{{projectName}}/Classes/**/*.swift'
|
||||||
{{#usePromiseKit}}
|
{{#usePromiseKit}}
|
||||||
s.dependency 'PromiseKit', '~> 3.5.3'
|
s.dependency 'PromiseKit', '~> 3.5.3'
|
||||||
{{/usePromiseKit}}
|
{{/usePromiseKit}}
|
||||||
|
@ -14,7 +14,7 @@ Pod::Spec.new do |s|
|
|||||||
s.description = '{{podDescription}}'{{/podDescription}}{{#podScreenshots}}
|
s.description = '{{podDescription}}'{{/podDescription}}{{#podScreenshots}}
|
||||||
s.screenshots = {{& podScreenshots}}{{/podScreenshots}}{{#podDocumentationURL}}
|
s.screenshots = {{& podScreenshots}}{{/podScreenshots}}{{#podDocumentationURL}}
|
||||||
s.documentation_url = '{{podDocumentationURL}}'{{/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 'PromiseKit', '~> 4.2.2'{{/usePromiseKit}}{{#useRxSwift}}
|
||||||
s.dependency 'RxSwift', '~> 3.4.1'{{/useRxSwift}}
|
s.dependency 'RxSwift', '~> 3.4.1'{{/useRxSwift}}
|
||||||
s.dependency 'Alamofire', '~> 4.0'
|
s.dependency 'Alamofire', '~> 4.0'
|
||||||
|
@ -14,7 +14,7 @@ Pod::Spec.new do |s|
|
|||||||
s.description = '{{podDescription}}'{{/podDescription}}{{#podScreenshots}}
|
s.description = '{{podDescription}}'{{/podDescription}}{{#podScreenshots}}
|
||||||
s.screenshots = {{& podScreenshots}}{{/podScreenshots}}{{#podDocumentationURL}}
|
s.screenshots = {{& podScreenshots}}{{/podScreenshots}}{{#podDocumentationURL}}
|
||||||
s.documentation_url = '{{podDocumentationURL}}'{{/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 'PromiseKit', '~> 4.2.2'{{/usePromiseKit}}{{#useRxSwift}}
|
||||||
s.dependency 'RxSwift', '~> 3.4.1'{{/useRxSwift}}
|
s.dependency 'RxSwift', '~> 3.4.1'{{/useRxSwift}}
|
||||||
s.dependency 'Alamofire', '~> 4.5'
|
s.dependency 'Alamofire', '~> 4.5'
|
||||||
|
@ -8,6 +8,6 @@ Pod::Spec.new do |s|
|
|||||||
s.license = 'Proprietary'
|
s.license = 'Proprietary'
|
||||||
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
||||||
s.summary = 'PetstoreClient'
|
s.summary = 'PetstoreClient'
|
||||||
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
|
s.source_files = 'PetstoreClient/Classes/**/*.swift'
|
||||||
s.dependency 'Alamofire', '~> 3.5.1'
|
s.dependency 'Alamofire', '~> 3.5.1'
|
||||||
end
|
end
|
||||||
|
@ -8,7 +8,7 @@ Pod::Spec.new do |s|
|
|||||||
s.license = 'Proprietary'
|
s.license = 'Proprietary'
|
||||||
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
||||||
s.summary = 'PetstoreClient'
|
s.summary = 'PetstoreClient'
|
||||||
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
|
s.source_files = 'PetstoreClient/Classes/**/*.swift'
|
||||||
s.dependency 'PromiseKit', '~> 3.5.3'
|
s.dependency 'PromiseKit', '~> 3.5.3'
|
||||||
s.dependency 'Alamofire', '~> 3.5.1'
|
s.dependency 'Alamofire', '~> 3.5.1'
|
||||||
end
|
end
|
||||||
|
@ -8,7 +8,7 @@ Pod::Spec.new do |s|
|
|||||||
s.license = 'Proprietary'
|
s.license = 'Proprietary'
|
||||||
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
||||||
s.summary = 'PetstoreClient'
|
s.summary = 'PetstoreClient'
|
||||||
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
|
s.source_files = 'PetstoreClient/Classes/**/*.swift'
|
||||||
s.dependency 'RxSwift', '~> 2.6.1'
|
s.dependency 'RxSwift', '~> 2.6.1'
|
||||||
s.dependency 'Alamofire', '~> 3.5.1'
|
s.dependency 'Alamofire', '~> 3.5.1'
|
||||||
end
|
end
|
||||||
|
@ -8,6 +8,6 @@ Pod::Spec.new do |s|
|
|||||||
s.license = 'Proprietary'
|
s.license = 'Proprietary'
|
||||||
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
||||||
s.summary = 'PetstoreClient'
|
s.summary = 'PetstoreClient'
|
||||||
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
|
s.source_files = 'PetstoreClient/Classes/**/*.swift'
|
||||||
s.dependency 'Alamofire', '~> 4.0'
|
s.dependency 'Alamofire', '~> 4.0'
|
||||||
end
|
end
|
||||||
|
@ -8,7 +8,7 @@ Pod::Spec.new do |s|
|
|||||||
s.license = 'Proprietary'
|
s.license = 'Proprietary'
|
||||||
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
||||||
s.summary = 'PetstoreClient'
|
s.summary = 'PetstoreClient'
|
||||||
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
|
s.source_files = 'PetstoreClient/Classes/**/*.swift'
|
||||||
s.dependency 'PromiseKit', '~> 4.2.2'
|
s.dependency 'PromiseKit', '~> 4.2.2'
|
||||||
s.dependency 'Alamofire', '~> 4.0'
|
s.dependency 'Alamofire', '~> 4.0'
|
||||||
end
|
end
|
||||||
|
@ -8,7 +8,7 @@ Pod::Spec.new do |s|
|
|||||||
s.license = 'Proprietary'
|
s.license = 'Proprietary'
|
||||||
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
||||||
s.summary = 'PetstoreClient'
|
s.summary = 'PetstoreClient'
|
||||||
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
|
s.source_files = 'PetstoreClient/Classes/**/*.swift'
|
||||||
s.dependency 'RxSwift', '~> 3.4.1'
|
s.dependency 'RxSwift', '~> 3.4.1'
|
||||||
s.dependency 'Alamofire', '~> 4.0'
|
s.dependency 'Alamofire', '~> 4.0'
|
||||||
end
|
end
|
||||||
|
@ -8,6 +8,6 @@ Pod::Spec.new do |s|
|
|||||||
s.license = 'Proprietary'
|
s.license = 'Proprietary'
|
||||||
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
||||||
s.summary = 'PetstoreClient'
|
s.summary = 'PetstoreClient'
|
||||||
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
|
s.source_files = 'PetstoreClient/Classes/**/*.swift'
|
||||||
s.dependency 'Alamofire', '~> 4.0'
|
s.dependency 'Alamofire', '~> 4.0'
|
||||||
end
|
end
|
||||||
|
@ -1 +1 @@
|
|||||||
2.2.3-SNAPSHOT
|
2.3.0-SNAPSHOT
|
@ -8,6 +8,6 @@ Pod::Spec.new do |s|
|
|||||||
s.license = 'Proprietary'
|
s.license = 'Proprietary'
|
||||||
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
||||||
s.summary = 'PetstoreClient'
|
s.summary = 'PetstoreClient'
|
||||||
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
|
s.source_files = 'PetstoreClient/Classes/**/*.swift'
|
||||||
s.dependency 'Alamofire', '~> 4.5'
|
s.dependency 'Alamofire', '~> 4.5'
|
||||||
end
|
end
|
||||||
|
@ -208,7 +208,7 @@ open class FakeAPI {
|
|||||||
- parameter callback: (form) None (optional)
|
- parameter callback: (form) None (optional)
|
||||||
- parameter completion: completion handler to receive the data and the error objects
|
- 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
|
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);
|
completion(error);
|
||||||
}
|
}
|
||||||
@ -240,7 +240,7 @@ open class FakeAPI {
|
|||||||
|
|
||||||
- returns: RequestBuilder<Void>
|
- 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 path = "/fake"
|
||||||
let URLString = PetstoreClientAPI.basePath + path
|
let URLString = PetstoreClientAPI.basePath + path
|
||||||
let formParams: [String:Any?] = [
|
let formParams: [String:Any?] = [
|
||||||
@ -325,7 +325,7 @@ open class FakeAPI {
|
|||||||
/**
|
/**
|
||||||
* enum for parameter enumQueryInteger
|
* enum for parameter enumQueryInteger
|
||||||
*/
|
*/
|
||||||
public enum EnumQueryInteger_testEnumParameters: Int32 {
|
public enum EnumQueryInteger_testEnumParameters: Int {
|
||||||
case _1 = 1
|
case _1 = 1
|
||||||
case numberminus2 = -2
|
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)
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -52,7 +52,7 @@ open class StoreAPI {
|
|||||||
|
|
||||||
- parameter completion: completion handler to receive the data and the error objects
|
- 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
|
getInventoryWithRequestBuilder().execute { (response, error) -> Void in
|
||||||
completion(response?.body, error);
|
completion(response?.body, error);
|
||||||
}
|
}
|
||||||
@ -70,9 +70,9 @@ open class StoreAPI {
|
|||||||
"key" : 0
|
"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 path = "/store/inventory"
|
||||||
let URLString = PetstoreClientAPI.basePath + path
|
let URLString = PetstoreClientAPI.basePath + path
|
||||||
let parameters: [String:Any]? = nil
|
let parameters: [String:Any]? = nil
|
||||||
@ -80,7 +80,7 @@ open class StoreAPI {
|
|||||||
let url = NSURLComponents(string: URLString)
|
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)
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
||||||
}
|
}
|
||||||
|
@ -244,8 +244,8 @@ open class UserAPI {
|
|||||||
Logs user into the system
|
Logs user into the system
|
||||||
- GET /user/login
|
- GET /user/login
|
||||||
-
|
-
|
||||||
- responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)]
|
- responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)]
|
||||||
- responseHeaders: [X-Rate-Limit(Int32), 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"}]
|
||||||
- examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}]
|
- examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}]
|
||||||
|
|
||||||
|
@ -35,7 +35,9 @@ open class CodableHelper {
|
|||||||
var returnedError: Error? = nil
|
var returnedError: Error? = nil
|
||||||
|
|
||||||
let encoder = JSONEncoder()
|
let encoder = JSONEncoder()
|
||||||
encoder.outputFormatting = (prettyPrint ? .prettyPrinted : .compact)
|
if prettyPrint {
|
||||||
|
encoder.outputFormatting = .prettyPrinted
|
||||||
|
}
|
||||||
encoder.dataEncodingStrategy = .base64Encode
|
encoder.dataEncodingStrategy = .base64Encode
|
||||||
if #available(iOS 10.0, *) {
|
if #available(iOS 10.0, *) {
|
||||||
encoder.dateEncodingStrategy = .iso8601
|
encoder.dateEncodingStrategy = .iso8601
|
||||||
|
@ -15,4 +15,10 @@ open class AdditionalPropertiesClass: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case mapProperty = "map_property"
|
||||||
|
case mapOfMapProperty = "map_of_map_property"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,10 @@ open class Animal: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case className = "className"
|
||||||
|
case color = "color"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,10 +10,17 @@ import Foundation
|
|||||||
|
|
||||||
open class ApiResponse: Codable {
|
open class ApiResponse: Codable {
|
||||||
|
|
||||||
public var code: Int32?
|
public var code: Int?
|
||||||
public var type: String?
|
public var type: String?
|
||||||
public var message: String?
|
public var message: String?
|
||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case code = "code"
|
||||||
|
case type = "type"
|
||||||
|
case message = "message"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class ArrayOfArrayOfNumberOnly: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case arrayArrayNumber = "ArrayArrayNumber"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class ArrayOfNumberOnly: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case arrayNumber = "ArrayNumber"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,4 +16,11 @@ open class ArrayTest: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case arrayOfString = "array_of_string"
|
||||||
|
case arrayArrayOfInteger = "array_array_of_integer"
|
||||||
|
case arrayArrayOfModel = "array_array_of_model"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -20,4 +20,14 @@ open class Capitalization: Codable {
|
|||||||
|
|
||||||
public init() {}
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class Cat: Animal {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case declawed = "declawed"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,10 @@ open class Category: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case id = "id"
|
||||||
|
case name = "name"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,9 @@ open class ClassModel: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case _class = "_class"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class Client: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case client = "client"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class Dog: Animal {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case breed = "breed"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,4 +23,10 @@ open class EnumArrays: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case justSymbol = "just_symbol"
|
||||||
|
case arrayEnum = "array_enum"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ open class EnumTest: Codable {
|
|||||||
case lower = "lower"
|
case lower = "lower"
|
||||||
case empty = ""
|
case empty = ""
|
||||||
}
|
}
|
||||||
public enum EnumInteger: Int32, Codable {
|
public enum EnumInteger: Int, Codable {
|
||||||
case _1 = 1
|
case _1 = 1
|
||||||
case numberminus1 = -1
|
case numberminus1 = -1
|
||||||
}
|
}
|
||||||
@ -30,4 +30,12 @@ open class EnumTest: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case enumString = "enum_string"
|
||||||
|
case enumInteger = "enum_integer"
|
||||||
|
case enumNumber = "enum_number"
|
||||||
|
case outerEnum = "outerEnum"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,8 @@ import Foundation
|
|||||||
|
|
||||||
open class FormatTest: Codable {
|
open class FormatTest: Codable {
|
||||||
|
|
||||||
public var integer: Int32?
|
public var integer: Int?
|
||||||
public var int32: Int32?
|
public var int32: Int?
|
||||||
public var int64: Int64?
|
public var int64: Int64?
|
||||||
public var number: Double?
|
public var number: Double?
|
||||||
public var float: Float?
|
public var float: Float?
|
||||||
@ -26,4 +26,21 @@ open class FormatTest: Codable {
|
|||||||
|
|
||||||
public init() {}
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,10 @@ open class HasOnlyReadOnly: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case bar = "bar"
|
||||||
|
case foo = "foo"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class List: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case _123List = "123-list"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,4 +19,10 @@ open class MapTest: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case mapMapOfString = "map_map_of_string"
|
||||||
|
case mapOfEnumString = "map_of_enum_string"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,4 +16,11 @@ open class MixedPropertiesAndAdditionalPropertiesClass: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case uuid = "uuid"
|
||||||
|
case dateTime = "dateTime"
|
||||||
|
case map = "map"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,9 +11,15 @@ import Foundation
|
|||||||
/** Model for testing model name starting with number */
|
/** Model for testing model name starting with number */
|
||||||
open class Model200Response: Codable {
|
open class Model200Response: Codable {
|
||||||
|
|
||||||
public var name: Int32?
|
public var name: Int?
|
||||||
public var _class: String?
|
public var _class: String?
|
||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case name = "name"
|
||||||
|
case _class = "class"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,11 +11,19 @@ import Foundation
|
|||||||
/** Model for testing model name same as property name */
|
/** Model for testing model name same as property name */
|
||||||
open class Name: Codable {
|
open class Name: Codable {
|
||||||
|
|
||||||
public var name: Int32?
|
public var name: Int?
|
||||||
public var snakeCase: Int32?
|
public var snakeCase: Int?
|
||||||
public var property: String?
|
public var property: String?
|
||||||
public var _123Number: Int32?
|
public var _123Number: Int?
|
||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case name = "name"
|
||||||
|
case snakeCase = "snake_case"
|
||||||
|
case property = "property"
|
||||||
|
case _123Number = "123Number"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class NumberOnly: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case justNumber = "JustNumber"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ open class Order: Codable {
|
|||||||
}
|
}
|
||||||
public var id: Int64?
|
public var id: Int64?
|
||||||
public var petId: Int64?
|
public var petId: Int64?
|
||||||
public var quantity: Int32?
|
public var quantity: Int?
|
||||||
public var shipDate: Date?
|
public var shipDate: Date?
|
||||||
/** Order Status */
|
/** Order Status */
|
||||||
public var status: Status?
|
public var status: Status?
|
||||||
@ -25,4 +25,14 @@ open class Order: Codable {
|
|||||||
|
|
||||||
public init() {}
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,4 +16,11 @@ open class OuterComposite: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case myNumber = "my_number"
|
||||||
|
case myString = "my_string"
|
||||||
|
case myBoolean = "my_boolean"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -25,4 +25,14 @@ open class Pet: Codable {
|
|||||||
|
|
||||||
public init() {}
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,10 @@ open class ReadOnlyFirst: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case bar = "bar"
|
||||||
|
case baz = "baz"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,13 @@ import Foundation
|
|||||||
/** Model for testing reserved words */
|
/** Model for testing reserved words */
|
||||||
open class Return: Codable {
|
open class Return: Codable {
|
||||||
|
|
||||||
public var _return: Int32?
|
public var _return: Int?
|
||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case _return = "return"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class SpecialModelName: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case specialPropertyName = "$special[property.name]"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,10 @@ open class Tag: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case id = "id"
|
||||||
|
case name = "name"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,20 @@ open class User: Codable {
|
|||||||
public var password: String?
|
public var password: String?
|
||||||
public var phone: String?
|
public var phone: String?
|
||||||
/** User Status */
|
/** User Status */
|
||||||
public var userStatus: Int32?
|
public var userStatus: Int?
|
||||||
|
|
||||||
public init() {}
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
2.2.3-SNAPSHOT
|
2.3.0-SNAPSHOT
|
@ -8,7 +8,7 @@ Pod::Spec.new do |s|
|
|||||||
s.license = 'Proprietary'
|
s.license = 'Proprietary'
|
||||||
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
||||||
s.summary = 'PetstoreClient'
|
s.summary = 'PetstoreClient'
|
||||||
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
|
s.source_files = 'PetstoreClient/Classes/**/*.swift'
|
||||||
s.dependency 'PromiseKit', '~> 4.2.2'
|
s.dependency 'PromiseKit', '~> 4.2.2'
|
||||||
s.dependency 'Alamofire', '~> 4.5'
|
s.dependency 'Alamofire', '~> 4.5'
|
||||||
end
|
end
|
||||||
|
@ -290,7 +290,7 @@ open class FakeAPI {
|
|||||||
- parameter callback: (form) None (optional)
|
- parameter callback: (form) None (optional)
|
||||||
- parameter completion: completion handler to receive the data and the error objects
|
- 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
|
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);
|
completion(error);
|
||||||
}
|
}
|
||||||
@ -315,7 +315,7 @@ open class FakeAPI {
|
|||||||
- parameter callback: (form) None (optional)
|
- parameter callback: (form) None (optional)
|
||||||
- returns: Promise<Void>
|
- 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()
|
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
|
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 {
|
if let error = error {
|
||||||
@ -352,7 +352,7 @@ open class FakeAPI {
|
|||||||
|
|
||||||
- returns: RequestBuilder<Void>
|
- 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 path = "/fake"
|
||||||
let URLString = PetstoreClientAPI.basePath + path
|
let URLString = PetstoreClientAPI.basePath + path
|
||||||
let formParams: [String:Any?] = [
|
let formParams: [String:Any?] = [
|
||||||
@ -437,7 +437,7 @@ open class FakeAPI {
|
|||||||
/**
|
/**
|
||||||
* enum for parameter enumQueryInteger
|
* enum for parameter enumQueryInteger
|
||||||
*/
|
*/
|
||||||
public enum EnumQueryInteger_testEnumParameters: Int32 {
|
public enum EnumQueryInteger_testEnumParameters: Int {
|
||||||
case _1 = 1
|
case _1 = 1
|
||||||
case numberminus2 = -2
|
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)
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -70,7 +70,7 @@ open class StoreAPI {
|
|||||||
|
|
||||||
- parameter completion: completion handler to receive the data and the error objects
|
- 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
|
getInventoryWithRequestBuilder().execute { (response, error) -> Void in
|
||||||
completion(response?.body, error);
|
completion(response?.body, error);
|
||||||
}
|
}
|
||||||
@ -79,10 +79,10 @@ open class StoreAPI {
|
|||||||
/**
|
/**
|
||||||
Returns pet inventories by status
|
Returns pet inventories by status
|
||||||
|
|
||||||
- returns: Promise<[String:Int32]>
|
- returns: Promise<[String:Int]>
|
||||||
*/
|
*/
|
||||||
open class func getInventory() -> Promise<[String:Int32]> {
|
open class func getInventory() -> Promise<[String:Int]> {
|
||||||
let deferred = Promise<[String:Int32]>.pending()
|
let deferred = Promise<[String:Int]>.pending()
|
||||||
getInventory() { data, error in
|
getInventory() { data, error in
|
||||||
if let error = error {
|
if let error = error {
|
||||||
deferred.reject(error)
|
deferred.reject(error)
|
||||||
@ -104,9 +104,9 @@ open class StoreAPI {
|
|||||||
"key" : 0
|
"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 path = "/store/inventory"
|
||||||
let URLString = PetstoreClientAPI.basePath + path
|
let URLString = PetstoreClientAPI.basePath + path
|
||||||
let parameters: [String:Any]? = nil
|
let parameters: [String:Any]? = nil
|
||||||
@ -114,7 +114,7 @@ open class StoreAPI {
|
|||||||
let url = NSURLComponents(string: URLString)
|
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)
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
||||||
}
|
}
|
||||||
|
@ -348,8 +348,8 @@ open class UserAPI {
|
|||||||
Logs user into the system
|
Logs user into the system
|
||||||
- GET /user/login
|
- GET /user/login
|
||||||
-
|
-
|
||||||
- responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)]
|
- responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)]
|
||||||
- responseHeaders: [X-Rate-Limit(Int32), 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"}]
|
||||||
- examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}]
|
- examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}]
|
||||||
|
|
||||||
|
@ -35,7 +35,9 @@ open class CodableHelper {
|
|||||||
var returnedError: Error? = nil
|
var returnedError: Error? = nil
|
||||||
|
|
||||||
let encoder = JSONEncoder()
|
let encoder = JSONEncoder()
|
||||||
encoder.outputFormatting = (prettyPrint ? .prettyPrinted : .compact)
|
if prettyPrint {
|
||||||
|
encoder.outputFormatting = .prettyPrinted
|
||||||
|
}
|
||||||
encoder.dataEncodingStrategy = .base64Encode
|
encoder.dataEncodingStrategy = .base64Encode
|
||||||
if #available(iOS 10.0, *) {
|
if #available(iOS 10.0, *) {
|
||||||
encoder.dateEncodingStrategy = .iso8601
|
encoder.dateEncodingStrategy = .iso8601
|
||||||
|
@ -15,4 +15,10 @@ open class AdditionalPropertiesClass: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case mapProperty = "map_property"
|
||||||
|
case mapOfMapProperty = "map_of_map_property"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,10 @@ open class Animal: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case className = "className"
|
||||||
|
case color = "color"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,10 +10,17 @@ import Foundation
|
|||||||
|
|
||||||
open class ApiResponse: Codable {
|
open class ApiResponse: Codable {
|
||||||
|
|
||||||
public var code: Int32?
|
public var code: Int?
|
||||||
public var type: String?
|
public var type: String?
|
||||||
public var message: String?
|
public var message: String?
|
||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case code = "code"
|
||||||
|
case type = "type"
|
||||||
|
case message = "message"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class ArrayOfArrayOfNumberOnly: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case arrayArrayNumber = "ArrayArrayNumber"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class ArrayOfNumberOnly: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case arrayNumber = "ArrayNumber"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,4 +16,11 @@ open class ArrayTest: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case arrayOfString = "array_of_string"
|
||||||
|
case arrayArrayOfInteger = "array_array_of_integer"
|
||||||
|
case arrayArrayOfModel = "array_array_of_model"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -20,4 +20,14 @@ open class Capitalization: Codable {
|
|||||||
|
|
||||||
public init() {}
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class Cat: Animal {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case declawed = "declawed"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,10 @@ open class Category: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case id = "id"
|
||||||
|
case name = "name"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,9 @@ open class ClassModel: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case _class = "_class"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class Client: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case client = "client"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class Dog: Animal {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case breed = "breed"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,4 +23,10 @@ open class EnumArrays: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case justSymbol = "just_symbol"
|
||||||
|
case arrayEnum = "array_enum"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ open class EnumTest: Codable {
|
|||||||
case lower = "lower"
|
case lower = "lower"
|
||||||
case empty = ""
|
case empty = ""
|
||||||
}
|
}
|
||||||
public enum EnumInteger: Int32, Codable {
|
public enum EnumInteger: Int, Codable {
|
||||||
case _1 = 1
|
case _1 = 1
|
||||||
case numberminus1 = -1
|
case numberminus1 = -1
|
||||||
}
|
}
|
||||||
@ -30,4 +30,12 @@ open class EnumTest: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case enumString = "enum_string"
|
||||||
|
case enumInteger = "enum_integer"
|
||||||
|
case enumNumber = "enum_number"
|
||||||
|
case outerEnum = "outerEnum"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,8 @@ import Foundation
|
|||||||
|
|
||||||
open class FormatTest: Codable {
|
open class FormatTest: Codable {
|
||||||
|
|
||||||
public var integer: Int32?
|
public var integer: Int?
|
||||||
public var int32: Int32?
|
public var int32: Int?
|
||||||
public var int64: Int64?
|
public var int64: Int64?
|
||||||
public var number: Double?
|
public var number: Double?
|
||||||
public var float: Float?
|
public var float: Float?
|
||||||
@ -26,4 +26,21 @@ open class FormatTest: Codable {
|
|||||||
|
|
||||||
public init() {}
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,10 @@ open class HasOnlyReadOnly: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case bar = "bar"
|
||||||
|
case foo = "foo"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class List: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case _123List = "123-list"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,4 +19,10 @@ open class MapTest: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case mapMapOfString = "map_map_of_string"
|
||||||
|
case mapOfEnumString = "map_of_enum_string"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,4 +16,11 @@ open class MixedPropertiesAndAdditionalPropertiesClass: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case uuid = "uuid"
|
||||||
|
case dateTime = "dateTime"
|
||||||
|
case map = "map"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,9 +11,15 @@ import Foundation
|
|||||||
/** Model for testing model name starting with number */
|
/** Model for testing model name starting with number */
|
||||||
open class Model200Response: Codable {
|
open class Model200Response: Codable {
|
||||||
|
|
||||||
public var name: Int32?
|
public var name: Int?
|
||||||
public var _class: String?
|
public var _class: String?
|
||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case name = "name"
|
||||||
|
case _class = "class"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,11 +11,19 @@ import Foundation
|
|||||||
/** Model for testing model name same as property name */
|
/** Model for testing model name same as property name */
|
||||||
open class Name: Codable {
|
open class Name: Codable {
|
||||||
|
|
||||||
public var name: Int32?
|
public var name: Int?
|
||||||
public var snakeCase: Int32?
|
public var snakeCase: Int?
|
||||||
public var property: String?
|
public var property: String?
|
||||||
public var _123Number: Int32?
|
public var _123Number: Int?
|
||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case name = "name"
|
||||||
|
case snakeCase = "snake_case"
|
||||||
|
case property = "property"
|
||||||
|
case _123Number = "123Number"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class NumberOnly: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case justNumber = "JustNumber"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ open class Order: Codable {
|
|||||||
}
|
}
|
||||||
public var id: Int64?
|
public var id: Int64?
|
||||||
public var petId: Int64?
|
public var petId: Int64?
|
||||||
public var quantity: Int32?
|
public var quantity: Int?
|
||||||
public var shipDate: Date?
|
public var shipDate: Date?
|
||||||
/** Order Status */
|
/** Order Status */
|
||||||
public var status: Status?
|
public var status: Status?
|
||||||
@ -25,4 +25,14 @@ open class Order: Codable {
|
|||||||
|
|
||||||
public init() {}
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,4 +16,11 @@ open class OuterComposite: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case myNumber = "my_number"
|
||||||
|
case myString = "my_string"
|
||||||
|
case myBoolean = "my_boolean"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -25,4 +25,14 @@ open class Pet: Codable {
|
|||||||
|
|
||||||
public init() {}
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,10 @@ open class ReadOnlyFirst: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case bar = "bar"
|
||||||
|
case baz = "baz"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,13 @@ import Foundation
|
|||||||
/** Model for testing reserved words */
|
/** Model for testing reserved words */
|
||||||
open class Return: Codable {
|
open class Return: Codable {
|
||||||
|
|
||||||
public var _return: Int32?
|
public var _return: Int?
|
||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case _return = "return"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class SpecialModelName: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case specialPropertyName = "$special[property.name]"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,10 @@ open class Tag: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case id = "id"
|
||||||
|
case name = "name"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,20 @@ open class User: Codable {
|
|||||||
public var password: String?
|
public var password: String?
|
||||||
public var phone: String?
|
public var phone: String?
|
||||||
/** User Status */
|
/** User Status */
|
||||||
public var userStatus: Int32?
|
public var userStatus: Int?
|
||||||
|
|
||||||
public init() {}
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
2.2.3-SNAPSHOT
|
2.3.0-SNAPSHOT
|
@ -8,7 +8,7 @@ Pod::Spec.new do |s|
|
|||||||
s.license = 'Proprietary'
|
s.license = 'Proprietary'
|
||||||
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
s.homepage = 'https://github.com/swagger-api/swagger-codegen'
|
||||||
s.summary = 'PetstoreClient'
|
s.summary = 'PetstoreClient'
|
||||||
s.source_files = 'PetstoreClient/Classes/Swaggers/**/*.swift'
|
s.source_files = 'PetstoreClient/Classes/**/*.swift'
|
||||||
s.dependency 'RxSwift', '~> 3.4.1'
|
s.dependency 'RxSwift', '~> 3.4.1'
|
||||||
s.dependency 'Alamofire', '~> 4.5'
|
s.dependency 'Alamofire', '~> 4.5'
|
||||||
end
|
end
|
||||||
|
@ -300,7 +300,7 @@ open class FakeAPI {
|
|||||||
- parameter callback: (form) None (optional)
|
- parameter callback: (form) None (optional)
|
||||||
- parameter completion: completion handler to receive the data and the error objects
|
- 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
|
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);
|
completion(error);
|
||||||
}
|
}
|
||||||
@ -325,7 +325,7 @@ open class FakeAPI {
|
|||||||
- parameter callback: (form) None (optional)
|
- parameter callback: (form) None (optional)
|
||||||
- returns: Observable<Void>
|
- 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
|
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
|
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 {
|
if let error = error {
|
||||||
@ -364,7 +364,7 @@ open class FakeAPI {
|
|||||||
|
|
||||||
- returns: RequestBuilder<Void>
|
- 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 path = "/fake"
|
||||||
let URLString = PetstoreClientAPI.basePath + path
|
let URLString = PetstoreClientAPI.basePath + path
|
||||||
let formParams: [String:Any?] = [
|
let formParams: [String:Any?] = [
|
||||||
@ -449,7 +449,7 @@ open class FakeAPI {
|
|||||||
/**
|
/**
|
||||||
* enum for parameter enumQueryInteger
|
* enum for parameter enumQueryInteger
|
||||||
*/
|
*/
|
||||||
public enum EnumQueryInteger_testEnumParameters: Int32 {
|
public enum EnumQueryInteger_testEnumParameters: Int {
|
||||||
case _1 = 1
|
case _1 = 1
|
||||||
case numberminus2 = -2
|
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)
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -72,7 +72,7 @@ open class StoreAPI {
|
|||||||
|
|
||||||
- parameter completion: completion handler to receive the data and the error objects
|
- 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
|
getInventoryWithRequestBuilder().execute { (response, error) -> Void in
|
||||||
completion(response?.body, error);
|
completion(response?.body, error);
|
||||||
}
|
}
|
||||||
@ -81,9 +81,9 @@ open class StoreAPI {
|
|||||||
/**
|
/**
|
||||||
Returns pet inventories by status
|
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
|
return Observable.create { observer -> Disposable in
|
||||||
getInventory() { data, error in
|
getInventory() { data, error in
|
||||||
if let error = error {
|
if let error = error {
|
||||||
@ -108,9 +108,9 @@ open class StoreAPI {
|
|||||||
"key" : 0
|
"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 path = "/store/inventory"
|
||||||
let URLString = PetstoreClientAPI.basePath + path
|
let URLString = PetstoreClientAPI.basePath + path
|
||||||
let parameters: [String:Any]? = nil
|
let parameters: [String:Any]? = nil
|
||||||
@ -118,7 +118,7 @@ open class StoreAPI {
|
|||||||
let url = NSURLComponents(string: URLString)
|
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)
|
return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
|
||||||
}
|
}
|
||||||
|
@ -360,8 +360,8 @@ open class UserAPI {
|
|||||||
Logs user into the system
|
Logs user into the system
|
||||||
- GET /user/login
|
- GET /user/login
|
||||||
-
|
-
|
||||||
- responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)]
|
- responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)]
|
||||||
- responseHeaders: [X-Rate-Limit(Int32), 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"}]
|
||||||
- examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}]
|
- examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}]
|
||||||
|
|
||||||
|
@ -35,7 +35,9 @@ open class CodableHelper {
|
|||||||
var returnedError: Error? = nil
|
var returnedError: Error? = nil
|
||||||
|
|
||||||
let encoder = JSONEncoder()
|
let encoder = JSONEncoder()
|
||||||
encoder.outputFormatting = (prettyPrint ? .prettyPrinted : .compact)
|
if prettyPrint {
|
||||||
|
encoder.outputFormatting = .prettyPrinted
|
||||||
|
}
|
||||||
encoder.dataEncodingStrategy = .base64Encode
|
encoder.dataEncodingStrategy = .base64Encode
|
||||||
if #available(iOS 10.0, *) {
|
if #available(iOS 10.0, *) {
|
||||||
encoder.dateEncodingStrategy = .iso8601
|
encoder.dateEncodingStrategy = .iso8601
|
||||||
|
@ -15,4 +15,10 @@ open class AdditionalPropertiesClass: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case mapProperty = "map_property"
|
||||||
|
case mapOfMapProperty = "map_of_map_property"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,10 @@ open class Animal: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case className = "className"
|
||||||
|
case color = "color"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,10 +10,17 @@ import Foundation
|
|||||||
|
|
||||||
open class ApiResponse: Codable {
|
open class ApiResponse: Codable {
|
||||||
|
|
||||||
public var code: Int32?
|
public var code: Int?
|
||||||
public var type: String?
|
public var type: String?
|
||||||
public var message: String?
|
public var message: String?
|
||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case code = "code"
|
||||||
|
case type = "type"
|
||||||
|
case message = "message"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class ArrayOfArrayOfNumberOnly: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case arrayArrayNumber = "ArrayArrayNumber"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class ArrayOfNumberOnly: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case arrayNumber = "ArrayNumber"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,4 +16,11 @@ open class ArrayTest: Codable {
|
|||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case arrayOfString = "array_of_string"
|
||||||
|
case arrayArrayOfInteger = "array_array_of_integer"
|
||||||
|
case arrayArrayOfModel = "array_array_of_model"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -20,4 +20,14 @@ open class Capitalization: Codable {
|
|||||||
|
|
||||||
public init() {}
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,9 @@ open class Cat: Animal {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case declawed = "declawed"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,10 @@ open class Category: Codable {
|
|||||||
|
|
||||||
public init() {}
|
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
Loading…
x
Reference in New Issue
Block a user