Fix OpenAPI link in broken Swift4/5 README templates (#6035)

* Fix Swift README templates

* Update Swift4/5 samples
This commit is contained in:
iliaskarim 2020-04-23 22:36:52 -04:00 committed by GitHub
parent 4ed3421a77
commit bafed337b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
144 changed files with 474 additions and 533 deletions

View File

@ -5,7 +5,7 @@
{{/appDescriptionWithNewLines}} {{/appDescriptionWithNewLines}}
## Overview ## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.
- API version: {{appVersion}} - API version: {{appVersion}}
- Package version: {{packageVersion}} - Package version: {{packageVersion}}

View File

@ -5,7 +5,7 @@
{{/appDescriptionWithNewLines}} {{/appDescriptionWithNewLines}}
## Overview ## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.
- API version: {{appVersion}} - API version: {{appVersion}}
- Package version: {{packageVersion}} - Package version: {{packageVersion}}

View File

@ -1 +1 @@
4.3.0-SNAPSHOT 4.3.1-SNAPSHOT

View File

@ -299,8 +299,6 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1020; LastUpgradeCheck = 1020;
TargetAttributes = {
};
}; };
buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */;
compatibilityVersion = "Xcode 10.0"; compatibilityVersion = "Xcode 10.0";

View File

@ -3,7 +3,7 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
## Overview ## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.
- API version: 1.0.0 - API version: 1.0.0
- Package version: - Package version:

View File

@ -1 +1 @@
4.3.0-SNAPSHOT 4.3.1-SNAPSHOT

View File

@ -299,8 +299,6 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1020; LastUpgradeCheck = 1020;
TargetAttributes = {
};
}; };
buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */;
compatibilityVersion = "Xcode 10.0"; compatibilityVersion = "Xcode 10.0";

View File

@ -3,7 +3,7 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
## Overview ## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.
- API version: 1.0.0 - API version: 1.0.0
- Package version: - Package version:

View File

@ -1 +1 @@
4.3.0-SNAPSHOT 4.3.1-SNAPSHOT

View File

@ -299,8 +299,6 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1020; LastUpgradeCheck = 1020;
TargetAttributes = {
};
}; };
buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */;
compatibilityVersion = "Xcode 10.0"; compatibilityVersion = "Xcode 10.0";

View File

@ -3,7 +3,7 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
## Overview ## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.
- API version: 1.0.0 - API version: 1.0.0
- Package version: - Package version:

View File

@ -1 +1 @@
4.3.0-SNAPSHOT 4.3.1-SNAPSHOT

View File

@ -303,8 +303,6 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1020; LastUpgradeCheck = 1020;
TargetAttributes = {
};
}; };
buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */;
compatibilityVersion = "Xcode 10.0"; compatibilityVersion = "Xcode 10.0";

View File

@ -3,7 +3,7 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
## Overview ## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.
- API version: 1.0.0 - API version: 1.0.0
- Package version: - Package version:

View File

@ -1 +1 @@
4.3.0-SNAPSHOT 4.3.1-SNAPSHOT

View File

@ -302,8 +302,6 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1020; LastUpgradeCheck = 1020;
TargetAttributes = {
};
}; };
buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */;
compatibilityVersion = "Xcode 10.0"; compatibilityVersion = "Xcode 10.0";

View File

@ -3,7 +3,7 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
## Overview ## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.
- API version: 1.0.0 - API version: 1.0.0
- Package version: - Package version:

View File

@ -1 +1 @@
4.3.0-SNAPSHOT 4.3.1-SNAPSHOT

View File

@ -303,8 +303,6 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1020; LastUpgradeCheck = 1020;
TargetAttributes = {
};
}; };
buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */;
compatibilityVersion = "Xcode 10.0"; compatibilityVersion = "Xcode 10.0";

View File

@ -3,7 +3,7 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
## Overview ## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.
- API version: 1.0.0 - API version: 1.0.0
- Package version: - Package version:

View File

@ -1 +1 @@
4.3.0-SNAPSHOT 4.3.1-SNAPSHOT

View File

@ -299,8 +299,6 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1020; LastUpgradeCheck = 1020;
TargetAttributes = {
};
}; };
buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */;
compatibilityVersion = "Xcode 10.0"; compatibilityVersion = "Xcode 10.0";

View File

@ -3,7 +3,7 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
## Overview ## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.
- API version: 1.0.0 - API version: 1.0.0
- Package version: - Package version:

View File

@ -305,14 +305,13 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1020; LastUpgradeCheck = 1020;
TargetAttributes = {
};
}; };
buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */;
compatibilityVersion = "Xcode 10.0"; compatibilityVersion = "Xcode 10.0";
developmentRegion = en; developmentRegion = en;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
knownRegions = ( knownRegions = (
Base,
en, en,
); );
mainGroup = 5FBA6AE5F64CD737F88B4565; mainGroup = 5FBA6AE5F64CD737F88B4565;
@ -568,7 +567,7 @@
3B2C02AFB91CB5C82766ED5C /* Release */, 3B2C02AFB91CB5C82766ED5C /* Release */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug; defaultConfigurationName = "";
}; };
ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;

View File

@ -2,6 +2,6 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "self:PetstoreClient.xcodeproj"> location = "self:">
</FileRef> </FileRef>
</Workspace> </Workspace>

View File

@ -41,6 +41,10 @@
</MacroExpansion> </MacroExpansion>
<CommandLineArguments> <CommandLineArguments>
</CommandLineArguments> </CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
<CodeCoverageTargets>
</CodeCoverageTargets>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Debug" buildConfiguration = "Debug"
@ -63,6 +67,8 @@
</MacroExpansion> </MacroExpansion>
<CommandLineArguments> <CommandLineArguments>
</CommandLineArguments> </CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction> </LaunchAction>
<ProfileAction <ProfileAction
buildConfiguration = "Release" buildConfiguration = "Release"

View File

@ -41,7 +41,7 @@ open class RequestBuilder<T> {
} }
} }
open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result<Response<T>, Error>) -> Void) { } open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result<Response<T>, Error>) -> Void) { }
public func addHeader(name: String, value: String) -> Self { public func addHeader(name: String, value: String) -> Self {
if !value.isEmpty { if !value.isEmpty {

View File

@ -38,11 +38,11 @@ open class CodableHelper {
set { self.customJSONEncoder = newValue } set { self.customJSONEncoder = newValue }
} }
open class func decode<T>(_ type: T.Type, from data: Data) -> Result<T, Error> where T: Decodable { open class func decode<T>(_ type: T.Type, from data: Data) -> Swift.Result<T, Error> where T: Decodable {
return Result { try self.jsonDecoder.decode(type, from: data) } return Swift.Result { try self.jsonDecoder.decode(type, from: data) }
} }
open class func encode<T>(_ value: T) -> Result<Data, Error> where T: Encodable { open class func encode<T>(_ value: T) -> Swift.Result<Data, Error> where T: Encodable {
return Result { try self.jsonEncoder.encode(value) } return Swift.Result { try self.jsonEncoder.encode(value) }
} }
} }

View File

@ -3,7 +3,7 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
## Overview ## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.
- API version: 1.0.0 - API version: 1.0.0
- Package version: - Package version:

View File

@ -265,14 +265,13 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1020; LastUpgradeCheck = 1020;
TargetAttributes = {
};
}; };
buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */;
compatibilityVersion = "Xcode 10.0"; compatibilityVersion = "Xcode 10.0";
developmentRegion = en; developmentRegion = en;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
knownRegions = ( knownRegions = (
Base,
en, en,
); );
mainGroup = 5FBA6AE5F64CD737F88B4565; mainGroup = 5FBA6AE5F64CD737F88B4565;
@ -520,7 +519,7 @@
3B2C02AFB91CB5C82766ED5C /* Release */, 3B2C02AFB91CB5C82766ED5C /* Release */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug; defaultConfigurationName = "";
}; };
ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;

View File

@ -2,6 +2,6 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "self:PetstoreClient.xcodeproj"> location = "self:">
</FileRef> </FileRef>
</Workspace> </Workspace>

View File

@ -41,6 +41,10 @@
</MacroExpansion> </MacroExpansion>
<CommandLineArguments> <CommandLineArguments>
</CommandLineArguments> </CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
<CodeCoverageTargets>
</CodeCoverageTargets>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Debug" buildConfiguration = "Debug"
@ -63,6 +67,8 @@
</MacroExpansion> </MacroExpansion>
<CommandLineArguments> <CommandLineArguments>
</CommandLineArguments> </CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction> </LaunchAction>
<ProfileAction <ProfileAction
buildConfiguration = "Release" buildConfiguration = "Release"

View File

@ -43,7 +43,7 @@ open class RequestBuilder<T> {
} }
} }
open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result<Response<T>, Error>) -> Void) { } open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result<Response<T>, Error>) -> Void) { }
public func addHeader(name: String, value: String) -> Self { public func addHeader(name: String, value: String) -> Self {
if !value.isEmpty { if !value.isEmpty {

View File

@ -38,11 +38,11 @@ open class CodableHelper {
set { self.customJSONEncoder = newValue } set { self.customJSONEncoder = newValue }
} }
open class func decode<T>(_ type: T.Type, from data: Data) -> Result<T, Error> where T: Decodable { open class func decode<T>(_ type: T.Type, from data: Data) -> Swift.Result<T, Error> where T: Decodable {
return Result { try self.jsonDecoder.decode(type, from: data) } return Swift.Result { try self.jsonDecoder.decode(type, from: data) }
} }
open class func encode<T>(_ value: T) -> Result<Data, Error> where T: Encodable { open class func encode<T>(_ value: T) -> Swift.Result<Data, Error> where T: Encodable {
return Result { try self.jsonEncoder.encode(value) } return Swift.Result { try self.jsonEncoder.encode(value) }
} }
} }

View File

@ -102,7 +102,7 @@ open class URLSessionRequestBuilder<T>: RequestBuilder<T> {
return modifiedRequest return modifiedRequest
} }
override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result<Response<T>, Error>) -> Void) { override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result<Response<T>, Error>) -> Void) {
let urlSessionId: String = UUID().uuidString let urlSessionId: String = UUID().uuidString
// Create a new manager for each request to customize its request header // Create a new manager for each request to customize its request header
let urlSession = createURLSession() let urlSession = createURLSession()
@ -180,7 +180,7 @@ open class URLSessionRequestBuilder<T>: RequestBuilder<T> {
} }
fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result<Response<T>, Error>) -> Void) { fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result<Response<T>, Error>) -> Void) {
if let error = error { if let error = error {
completion(.failure(ErrorResponse.error(-1, data, error))) completion(.failure(ErrorResponse.error(-1, data, error)))
@ -312,7 +312,7 @@ open class URLSessionRequestBuilder<T>: RequestBuilder<T> {
} }
open class URLSessionDecodableRequestBuilder<T: Decodable>: URLSessionRequestBuilder<T> { open class URLSessionDecodableRequestBuilder<T: Decodable>: URLSessionRequestBuilder<T> {
override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result<Response<T>, Error>) -> Void) { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result<Response<T>, Error>) -> Void) {
if let error = error { if let error = error {
completion(.failure(ErrorResponse.error(-1, data, error))) completion(.failure(ErrorResponse.error(-1, data, error)))

View File

@ -3,7 +3,7 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
## Overview ## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.
- API version: 1.0.0 - API version: 1.0.0
- Package version: - Package version:

View File

@ -14,7 +14,7 @@ let package = Package(
// Products define the executables and libraries produced by a package, and make them visible to other packages. // Products define the executables and libraries produced by a package, and make them visible to other packages.
.library( .library(
name: "PetstoreClient", name: "PetstoreClient",
targets: ["PetstoreClient"]), targets: ["PetstoreClient"])
], ],
dependencies: [ dependencies: [
// Dependencies declare other packages that this package depends on. // Dependencies declare other packages that this package depends on.
@ -26,6 +26,6 @@ let package = Package(
name: "PetstoreClient", name: "PetstoreClient",
dependencies: [], dependencies: [],
path: "PetstoreClient/Classes" path: "PetstoreClient/Classes"
), )
] ]
) )

View File

@ -265,14 +265,13 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1020; LastUpgradeCheck = 1020;
TargetAttributes = {
};
}; };
buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */;
compatibilityVersion = "Xcode 10.0"; compatibilityVersion = "Xcode 10.0";
developmentRegion = en; developmentRegion = en;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
knownRegions = ( knownRegions = (
Base,
en, en,
); );
mainGroup = 5FBA6AE5F64CD737F88B4565; mainGroup = 5FBA6AE5F64CD737F88B4565;
@ -520,7 +519,7 @@
3B2C02AFB91CB5C82766ED5C /* Release */, 3B2C02AFB91CB5C82766ED5C /* Release */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug; defaultConfigurationName = "";
}; };
ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;

View File

@ -2,6 +2,6 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "self:PetstoreClient.xcodeproj"> location = "self:">
</FileRef> </FileRef>
</Workspace> </Workspace>

View File

@ -41,6 +41,10 @@
</MacroExpansion> </MacroExpansion>
<CommandLineArguments> <CommandLineArguments>
</CommandLineArguments> </CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
<CodeCoverageTargets>
</CodeCoverageTargets>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Debug" buildConfiguration = "Debug"
@ -63,6 +67,8 @@
</MacroExpansion> </MacroExpansion>
<CommandLineArguments> <CommandLineArguments>
</CommandLineArguments> </CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction> </LaunchAction>
<ProfileAction <ProfileAction
buildConfiguration = "Release" buildConfiguration = "Release"

View File

@ -22,7 +22,7 @@ public struct APIHelper {
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
return source.reduce(into: [String: String]()) { (result, item) in return source.reduce(into: [String: String]()) { (result, item) in
if let collection = item.value as? Array<Any?> { if let collection = item.value as? [Any?] {
result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",")
} else if let value: Any = item.value { } else if let value: Any = item.value {
result[item.key] = "\(value)" result[item.key] = "\(value)"
@ -46,7 +46,7 @@ public struct APIHelper {
} }
public static func mapValueToPathItem(_ source: Any) -> Any { public static func mapValueToPathItem(_ source: Any) -> Any {
if let collection = source as? Array<Any?> { if let collection = source as? [Any?] {
return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
} }
return source return source
@ -54,7 +54,7 @@ public struct APIHelper {
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in
if let collection = item.value as? Array<Any?> { if let collection = item.value as? [Any?] {
let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",")
result.append(URLQueryItem(name: item.key, value: value)) result.append(URLQueryItem(name: item.key, value: value))
} else if let value = item.value { } else if let value = item.value {
@ -68,4 +68,3 @@ public struct APIHelper {
return destination return destination
} }
} }

View File

@ -25,7 +25,7 @@ open class RequestBuilder<T> {
/// Optional block to obtain a reference to the request's progress instance when available. /// Optional block to obtain a reference to the request's progress instance when available.
/// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0.
/// If you need to get the request's progress in older OS versions, please use Alamofire http client. /// If you need to get the request's progress in older OS versions, please use Alamofire http client.
public var onProgressReady: ((Progress) -> ())? public var onProgressReady: ((Progress) -> Void)?
required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) {
self.method = method self.method = method

View File

@ -7,8 +7,6 @@
import Foundation import Foundation
open class AnotherFakeAPI { open class AnotherFakeAPI {
/** /**
To test special tags To test special tags

View File

@ -7,8 +7,6 @@
import Foundation import Foundation
open class FakeAPI { open class FakeAPI {
/** /**

View File

@ -7,8 +7,6 @@
import Foundation import Foundation
open class FakeClassnameTags123API { open class FakeClassnameTags123API {
/** /**
To test class name in snake case To test class name in snake case

View File

@ -7,8 +7,6 @@
import Foundation import Foundation
open class PetAPI { open class PetAPI {
/** /**
Add a new pet to the store Add a new pet to the store

View File

@ -7,8 +7,6 @@
import Foundation import Foundation
open class StoreAPI { open class StoreAPI {
/** /**
Delete purchase order by ID Delete purchase order by ID

View File

@ -7,8 +7,6 @@
import Foundation import Foundation
open class UserAPI { open class UserAPI {
/** /**
Create user Create user

View File

@ -148,7 +148,7 @@ extension KeyedDecodingContainerProtocol {
} }
public func decodeArrayIfPresent<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { public func decodeArrayIfPresent<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable {
var tmpArray: [T]? = nil var tmpArray: [T]?
if contains(key) { if contains(key) {
tmpArray = try decodeArray(T.self, forKey: key) tmpArray = try decodeArray(T.self, forKey: key)
@ -177,5 +177,3 @@ extension HTTPURLResponse {
return Array(200 ..< 300).contains(statusCode) return Array(200 ..< 300).contains(statusCode)
} }
} }

View File

@ -41,7 +41,7 @@ public struct JSONDataEncoding {
} }
public static func encodingParameters(jsonData: Data?) -> [String: Any]? { public static func encodingParameters(jsonData: Data?) -> [String: Any]? {
var returnedParams: [String: Any]? = nil var returnedParams: [String: Any]?
if let jsonData = jsonData, !jsonData.isEmpty { if let jsonData = jsonData, !jsonData.isEmpty {
var params: [String: Any] = [:] var params: [String: Any] = [:]
params[jsonDataKey] = jsonData params[jsonDataKey] = jsonData

View File

@ -10,7 +10,7 @@ import Foundation
open class JSONEncodingHelper { open class JSONEncodingHelper {
open class func encodingParameters<T: Encodable>(forEncodableObject encodableObj: T?) -> [String: Any]? { open class func encodingParameters<T: Encodable>(forEncodableObject encodableObj: T?) -> [String: Any]? {
var params: [String: Any]? = nil var params: [String: Any]?
// Encode the Encodable object // Encode the Encodable object
if let encodableObj = encodableObj { if let encodableObj = encodableObj {
@ -27,7 +27,7 @@ open class JSONEncodingHelper {
} }
open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? {
var params: [String: Any]? = nil var params: [String: Any]?
if let encodableObj = encodableObj { if let encodableObj = encodableObj {
do { do {

View File

@ -30,7 +30,6 @@ public enum DecodableRequestBuilderError: Error {
case generalError(Error) case generalError(Error)
} }
open class Response<T> { open class Response<T> {
public let statusCode: Int public let statusCode: Int
public let header: [String: String] public let header: [String: String]

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct AdditionalPropertiesClass: Codable { public struct AdditionalPropertiesClass: Codable {
public var mapString: [String: String]? public var mapString: [String: String]?
public var mapMapString: [String: [String: String]]? public var mapMapString: [String: [String: String]]?

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct Animal: Codable { public struct Animal: Codable {
public var className: String public var className: String
public var color: String? = "red" public var color: String? = "red"

View File

@ -7,5 +7,4 @@
import Foundation import Foundation
public typealias AnimalFarm = [Animal] public typealias AnimalFarm = [Animal]

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct ApiResponse: Codable { public struct ApiResponse: Codable {
public var code: Int? public var code: Int?
public var type: String? public var type: String?
public var message: String? public var message: String?

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct ArrayOfArrayOfNumberOnly: Codable { public struct ArrayOfArrayOfNumberOnly: Codable {
public var arrayArrayNumber: [[Double]]? public var arrayArrayNumber: [[Double]]?
public init(arrayArrayNumber: [[Double]]?) { public init(arrayArrayNumber: [[Double]]?) {

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct ArrayOfNumberOnly: Codable { public struct ArrayOfNumberOnly: Codable {
public var arrayNumber: [Double]? public var arrayNumber: [Double]?
public init(arrayNumber: [Double]?) { public init(arrayNumber: [Double]?) {

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct ArrayTest: Codable { public struct ArrayTest: Codable {
public var arrayOfString: [String]? public var arrayOfString: [String]?
public var arrayArrayOfInteger: [[Int64]]? public var arrayArrayOfInteger: [[Int64]]?
public var arrayArrayOfModel: [[ReadOnlyFirst]]? public var arrayArrayOfModel: [[ReadOnlyFirst]]?

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct Capitalization: Codable { public struct Capitalization: Codable {
public var smallCamel: String? public var smallCamel: String?
public var capitalCamel: String? public var capitalCamel: String?
public var smallSnake: String? public var smallSnake: String?

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct Cat: Codable { public struct Cat: Codable {
public var className: String public var className: String
public var color: String? = "red" public var color: String? = "red"
public var declawed: Bool? public var declawed: Bool?

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct CatAllOf: Codable { public struct CatAllOf: Codable {
public var declawed: Bool? public var declawed: Bool?
public init(declawed: Bool?) { public init(declawed: Bool?) {

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct Category: Codable { public struct Category: Codable {
public var id: Int64? public var id: Int64?
public var name: String = "default-name" public var name: String = "default-name"

View File

@ -10,7 +10,6 @@ import Foundation
/** Model for testing model with \&quot;_class\&quot; property */ /** Model for testing model with \&quot;_class\&quot; property */
public struct ClassModel: Codable { public struct ClassModel: Codable {
public var _class: String? public var _class: String?
public init(_class: String?) { public init(_class: String?) {

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct Client: Codable { public struct Client: Codable {
public var client: String? public var client: String?
public init(client: String?) { public init(client: String?) {

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct Dog: Codable { public struct Dog: Codable {
public var className: String public var className: String
public var color: String? = "red" public var color: String? = "red"
public var breed: String? public var breed: String?

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct DogAllOf: Codable { public struct DogAllOf: Codable {
public var breed: String? public var breed: String?
public init(breed: String?) { public init(breed: String?) {

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct EnumArrays: Codable { public struct EnumArrays: Codable {
public enum JustSymbol: String, Codable, CaseIterable { public enum JustSymbol: String, Codable, CaseIterable {
case greaterThanOrEqualTo = ">=" case greaterThanOrEqualTo = ">="
case dollar = "$" case dollar = "$"

View File

@ -7,7 +7,6 @@
import Foundation import Foundation
public enum EnumClass: String, Codable, CaseIterable { public enum EnumClass: String, Codable, CaseIterable {
case abc = "_abc" case abc = "_abc"
case efg = "-efg" case efg = "-efg"

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct EnumTest: Codable { public struct EnumTest: Codable {
public enum EnumString: String, Codable, CaseIterable { public enum EnumString: String, Codable, CaseIterable {
case upper = "UPPER" case upper = "UPPER"
case lower = "lower" case lower = "lower"

View File

@ -10,7 +10,6 @@ import Foundation
/** Must be named &#x60;File&#x60; for test. */ /** Must be named &#x60;File&#x60; for test. */
public struct File: Codable { public struct File: Codable {
/** Test capitalization */ /** Test capitalization */
public var sourceURI: String? public var sourceURI: String?

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct FileSchemaTestClass: Codable { public struct FileSchemaTestClass: Codable {
public var file: File? public var file: File?
public var files: [File]? public var files: [File]?

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct FormatTest: Codable { public struct FormatTest: Codable {
public var integer: Int? public var integer: Int?
public var int32: Int? public var int32: Int?
public var int64: Int64? public var int64: Int64?

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct HasOnlyReadOnly: Codable { public struct HasOnlyReadOnly: Codable {
public var bar: String? public var bar: String?
public var foo: String? public var foo: String?

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct List: Codable { public struct List: Codable {
public var _123list: String? public var _123list: String?
public init(_123list: String?) { public init(_123list: String?) {

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct MapTest: Codable { public struct MapTest: Codable {
public enum MapOfEnumString: String, Codable, CaseIterable { public enum MapOfEnumString: String, Codable, CaseIterable {
case upper = "UPPER" case upper = "UPPER"
case lower = "lower" case lower = "lower"

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public struct MixedPropertiesAndAdditionalPropertiesClass: Codable {
public var uuid: UUID? public var uuid: UUID?
public var dateTime: Date? public var dateTime: Date?
public var map: [String: Animal]? public var map: [String: Animal]?

View File

@ -10,7 +10,6 @@ import Foundation
/** Model for testing model name starting with number */ /** Model for testing model name starting with number */
public struct Model200Response: Codable { public struct Model200Response: Codable {
public var name: Int? public var name: Int?
public var _class: String? public var _class: String?

View File

@ -10,7 +10,6 @@ import Foundation
/** Model for testing model name same as property name */ /** Model for testing model name same as property name */
public struct Name: Codable { public struct Name: Codable {
public var name: Int public var name: Int
public var snakeCase: Int? public var snakeCase: Int?
public var property: String? public var property: String?

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct NumberOnly: Codable { public struct NumberOnly: Codable {
public var justNumber: Double? public var justNumber: Double?
public init(justNumber: Double?) { public init(justNumber: Double?) {

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct Order: Codable { public struct Order: Codable {
public enum Status: String, Codable, CaseIterable { public enum Status: String, Codable, CaseIterable {
case placed = "placed" case placed = "placed"
case approved = "approved" case approved = "approved"

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct OuterComposite: Codable { public struct OuterComposite: Codable {
public var myNumber: Double? public var myNumber: Double?
public var myString: String? public var myString: String?
public var myBoolean: Bool? public var myBoolean: Bool?

View File

@ -7,7 +7,6 @@
import Foundation import Foundation
public enum OuterEnum: String, Codable, CaseIterable { public enum OuterEnum: String, Codable, CaseIterable {
case placed = "placed" case placed = "placed"
case approved = "approved" case approved = "approved"

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct Pet: Codable { public struct Pet: Codable {
public enum Status: String, Codable, CaseIterable { public enum Status: String, Codable, CaseIterable {
case available = "available" case available = "available"
case pending = "pending" case pending = "pending"

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct ReadOnlyFirst: Codable { public struct ReadOnlyFirst: Codable {
public var bar: String? public var bar: String?
public var baz: String? public var baz: String?

View File

@ -10,7 +10,6 @@ import Foundation
/** Model for testing reserved words */ /** Model for testing reserved words */
public struct Return: Codable { public struct Return: Codable {
public var _return: Int? public var _return: Int?
public init(_return: Int?) { public init(_return: Int?) {

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct SpecialModelName: Codable { public struct SpecialModelName: Codable {
public var specialPropertyName: Int64? public var specialPropertyName: Int64?
public init(specialPropertyName: Int64?) { public init(specialPropertyName: Int64?) {

View File

@ -7,11 +7,8 @@
import Foundation import Foundation
public struct StringBooleanMap: Codable { public struct StringBooleanMap: Codable {
public var additionalProperties: [String: Bool] = [:] public var additionalProperties: [String: Bool] = [:]
public subscript(key: String) -> Bool? { public subscript(key: String) -> Bool? {
@ -45,5 +42,4 @@ public struct StringBooleanMap: Codable {
additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys)
} }
} }

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct Tag: Codable { public struct Tag: Codable {
public var id: Int64? public var id: Int64?
public var name: String? public var name: String?

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct TypeHolderDefault: Codable { public struct TypeHolderDefault: Codable {
public var stringItem: String = "what" public var stringItem: String = "what"
public var numberItem: Double public var numberItem: Double
public var integerItem: Int public var integerItem: Int

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct TypeHolderExample: Codable { public struct TypeHolderExample: Codable {
public var stringItem: String public var stringItem: String
public var numberItem: Double public var numberItem: Double
public var integerItem: Int public var integerItem: Int

View File

@ -7,10 +7,8 @@
import Foundation import Foundation
public struct User: Codable { public struct User: Codable {
public var id: Int64? public var id: Int64?
public var username: String? public var username: String?
public var firstName: String? public var firstName: String?

View File

@ -363,7 +363,7 @@ open class URLSessionDecodableRequestBuilder<T:Decodable>: URLSessionRequestBuil
} }
} }
fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate {
var credential: URLCredential? var credential: URLCredential?
@ -409,7 +409,7 @@ public protocol ParameterEncoding {
func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest
} }
fileprivate class URLEncoding: ParameterEncoding { private class URLEncoding: ParameterEncoding {
func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest {
var urlRequest = urlRequest var urlRequest = urlRequest
@ -429,7 +429,7 @@ fileprivate class URLEncoding: ParameterEncoding {
} }
} }
fileprivate class FileUploadEncoding: ParameterEncoding { private class FileUploadEncoding: ParameterEncoding {
let contentTypeForFormPart: (_ fileURL: URL) -> String? let contentTypeForFormPart: (_ fileURL: URL) -> String?

View File

@ -3,7 +3,7 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
## Overview ## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.
- API version: 1.0.0 - API version: 1.0.0
- Package version: - Package version:

View File

@ -265,14 +265,13 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1020; LastUpgradeCheck = 1020;
TargetAttributes = {
};
}; };
buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */;
compatibilityVersion = "Xcode 10.0"; compatibilityVersion = "Xcode 10.0";
developmentRegion = en; developmentRegion = en;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
knownRegions = ( knownRegions = (
Base,
en, en,
); );
mainGroup = 5FBA6AE5F64CD737F88B4565; mainGroup = 5FBA6AE5F64CD737F88B4565;
@ -520,7 +519,7 @@
3B2C02AFB91CB5C82766ED5C /* Release */, 3B2C02AFB91CB5C82766ED5C /* Release */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug; defaultConfigurationName = "";
}; };
ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;

View File

@ -2,6 +2,6 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "self:PetstoreClient.xcodeproj"> location = "self:">
</FileRef> </FileRef>
</Workspace> </Workspace>

View File

@ -41,6 +41,10 @@
</MacroExpansion> </MacroExpansion>
<CommandLineArguments> <CommandLineArguments>
</CommandLineArguments> </CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
<CodeCoverageTargets>
</CodeCoverageTargets>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Debug" buildConfiguration = "Debug"
@ -63,6 +67,8 @@
</MacroExpansion> </MacroExpansion>
<CommandLineArguments> <CommandLineArguments>
</CommandLineArguments> </CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction> </LaunchAction>
<ProfileAction <ProfileAction
buildConfiguration = "Release" buildConfiguration = "Release"

View File

@ -43,7 +43,7 @@ internal class RequestBuilder<T> {
} }
} }
internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result<Response<T>, Error>) -> Void) { } internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result<Response<T>, Error>) -> Void) { }
internal func addHeader(name: String, value: String) -> Self { internal func addHeader(name: String, value: String) -> Self {
if !value.isEmpty { if !value.isEmpty {

View File

@ -38,11 +38,11 @@ internal class CodableHelper {
set { self.customJSONEncoder = newValue } set { self.customJSONEncoder = newValue }
} }
internal class func decode<T>(_ type: T.Type, from data: Data) -> Result<T, Error> where T: Decodable { internal class func decode<T>(_ type: T.Type, from data: Data) -> Swift.Result<T, Error> where T: Decodable {
return Result { try self.jsonDecoder.decode(type, from: data) } return Swift.Result { try self.jsonDecoder.decode(type, from: data) }
} }
internal class func encode<T>(_ value: T) -> Result<Data, Error> where T: Encodable { internal class func encode<T>(_ value: T) -> Swift.Result<Data, Error> where T: Encodable {
return Result { try self.jsonEncoder.encode(value) } return Swift.Result { try self.jsonEncoder.encode(value) }
} }
} }

View File

@ -102,7 +102,7 @@ internal class URLSessionRequestBuilder<T>: RequestBuilder<T> {
return modifiedRequest return modifiedRequest
} }
override internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result<Response<T>, Error>) -> Void) { override internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result<Response<T>, Error>) -> Void) {
let urlSessionId: String = UUID().uuidString let urlSessionId: String = UUID().uuidString
// Create a new manager for each request to customize its request header // Create a new manager for each request to customize its request header
let urlSession = createURLSession() let urlSession = createURLSession()
@ -180,7 +180,7 @@ internal class URLSessionRequestBuilder<T>: RequestBuilder<T> {
} }
fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result<Response<T>, Error>) -> Void) { fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result<Response<T>, Error>) -> Void) {
if let error = error { if let error = error {
completion(.failure(ErrorResponse.error(-1, data, error))) completion(.failure(ErrorResponse.error(-1, data, error)))
@ -312,7 +312,7 @@ internal class URLSessionRequestBuilder<T>: RequestBuilder<T> {
} }
internal class URLSessionDecodableRequestBuilder<T: Decodable>: URLSessionRequestBuilder<T> { internal class URLSessionDecodableRequestBuilder<T: Decodable>: URLSessionRequestBuilder<T> {
override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result<Response<T>, Error>) -> Void) { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result<Response<T>, Error>) -> Void) {
if let error = error { if let error = error {
completion(.failure(ErrorResponse.error(-1, data, error))) completion(.failure(ErrorResponse.error(-1, data, error)))

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