forked from loafle/openapi-generator-original
[swift6] Change JSONEncodable protocol to always return String (#20906)
* [swift6] Change JSONEncodable protocol to always return String * [swift6] Upgrade Alamofire * Add missing @Sendable attributes * Fix APIHelperTests * Fix URLSessionImplementations
This commit is contained in:
parent
1eb8c58446
commit
31c1a86736
@ -8,8 +8,8 @@ import Foundation{{#useVapor}}
|
||||
import Vapor{{/useVapor}}
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct APIHelper {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func rejectNil(_ source: [String: Any?]) -> [String: Any]? {
|
||||
let destination = source.reduce(into: [String: Any]()) { result, item in
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? {
|
||||
let destination = source.reduce(into: [String: any Sendable]()) { result, item in
|
||||
if let value = item.value {
|
||||
result[item.key] = value
|
||||
}
|
||||
@ -21,7 +21,7 @@ import Vapor{{/useVapor}}
|
||||
return destination
|
||||
}
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] {
|
||||
return source.reduce(into: [String: String]()) { result, item in
|
||||
if let collection = item.value as? [Any?] {
|
||||
result[item.key] = collection
|
||||
@ -33,12 +33,12 @@ import Vapor{{/useVapor}}
|
||||
}
|
||||
}
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? {
|
||||
guard let source = source else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return source.reduce(into: [String: Any]()) { result, item in
|
||||
return source.reduce(into: [String: any Sendable]()) { result, item in
|
||||
switch item.value {
|
||||
case let x as Bool:
|
||||
result[item.key] = x.description
|
||||
@ -100,7 +100,7 @@ import Vapor{{/useVapor}}
|
||||
/// maps all values from source to query parameters
|
||||
///
|
||||
/// collection values are always exploded
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func mapValuesToQueryItems(_ source: [String: (any Sendable)?]) -> [URLQueryItem]? {
|
||||
let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in
|
||||
if let collection = item.value as? [Any?] {
|
||||
collection
|
||||
|
@ -85,7 +85,7 @@ import Alamofire{{/useAlamofire}}
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class RequestBuilder<T>: @unchecked Sendable {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var credential: URLCredential?
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var headers: [String: String]
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let parameters: [String: Any]?
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let parameters: [String: any Sendable]?
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let method: String
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let URLString: String
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let requestTask: RequestTask = RequestTask()
|
||||
@ -95,7 +95,7 @@ import Alamofire{{/useAlamofire}}
|
||||
/// Optional block to obtain a reference to the request's progress instance when available.
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var onProgressReady: ((Progress) -> Void)?
|
||||
|
||||
required {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared) {
|
||||
required {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared) {
|
||||
self.method = method
|
||||
self.URLString = URLString
|
||||
self.parameters = parameters
|
||||
|
@ -1,5 +1,4 @@
|
||||
{{#useAlamofire}}
|
||||
# TODO: Alamofire versions 5.10.0 and above are not currently supported. If you need a newer version, please consider submitting a Pull Request with the required changes.
|
||||
github "Alamofire/Alamofire" = 5.9.1{{/useAlamofire}}{{#usePromiseKit}}
|
||||
github "Alamofire/Alamofire" = 5.10.2{{/useAlamofire}}{{#usePromiseKit}}
|
||||
github "mxcl/PromiseKit" ~> 8.1{{/usePromiseKit}}{{#useRxSwift}}
|
||||
github "ReactiveX/RxSwift" ~> 6.8{{/useRxSwift}}
|
||||
|
@ -11,73 +11,49 @@ import FoundationNetworking
|
||||
@preconcurrency import PromiseKit{{/usePromiseKit}}{{#useVapor}}
|
||||
import Vapor{{/useVapor}}{{^useVapor}}
|
||||
|
||||
extension Bool: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
extension Bool: QueryStringEncodable {}
|
||||
extension Float: QueryStringEncodable {}
|
||||
extension Int: QueryStringEncodable {}
|
||||
extension Int32: QueryStringEncodable {}
|
||||
extension Int64: QueryStringEncodable {}
|
||||
extension Double: QueryStringEncodable {}
|
||||
extension Decimal: QueryStringEncodable {}
|
||||
extension String: QueryStringEncodable {}
|
||||
extension URL: QueryStringEncodable {}
|
||||
extension UUID: QueryStringEncodable {}
|
||||
|
||||
extension QueryStringEncodable {
|
||||
@_disfavoredOverload
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) }
|
||||
}
|
||||
|
||||
extension Float: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
extension RawRepresentable where RawValue: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) }
|
||||
}
|
||||
|
||||
extension Int: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension Int32: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension Int64: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension Double: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension Decimal: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension String: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension URL: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension UUID: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension RawRepresentable where RawValue: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { return self.rawValue }
|
||||
}
|
||||
|
||||
private func encodeIfPossible<T>(_ object: T, codableHelper: CodableHelper) -> Any {
|
||||
if let encodableObject = object as? JSONEncodable {
|
||||
return encodableObject.encodeToJSON(codableHelper: codableHelper)
|
||||
private func encodeIfPossible<T>(_ object: T, codableHelper: CodableHelper) -> String {
|
||||
if let encodableObject = object as? QueryStringEncodable {
|
||||
return encodableObject.encodeToQueryString(codableHelper: codableHelper)
|
||||
} else {
|
||||
return object
|
||||
return String(describing: object)
|
||||
}
|
||||
}
|
||||
|
||||
extension Array: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
extension Array {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> [String] {
|
||||
return self.map { encodeIfPossible($0, codableHelper: codableHelper) }
|
||||
}
|
||||
}
|
||||
|
||||
extension Set: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
return Array(self).encodeToJSON(codableHelper: codableHelper)
|
||||
extension Set {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> [String] {
|
||||
return Array(self).encodeToQueryString(codableHelper: codableHelper)
|
||||
}
|
||||
}
|
||||
|
||||
extension Dictionary: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
var dictionary = [AnyHashable: Any]()
|
||||
extension Dictionary {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> [Key: String] {
|
||||
var dictionary = [Key: String]()
|
||||
for (key, value) in self {
|
||||
dictionary[key] = encodeIfPossible(value, codableHelper: codableHelper)
|
||||
}
|
||||
@ -85,24 +61,24 @@ extension Dictionary: JSONEncodable {
|
||||
}
|
||||
}
|
||||
|
||||
extension Data: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
extension Data: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String {
|
||||
return self.base64EncodedString(options: Data.Base64EncodingOptions())
|
||||
}
|
||||
}
|
||||
|
||||
extension Date: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
extension Date: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String {
|
||||
return codableHelper.dateFormatter.string(from: self)
|
||||
}
|
||||
}
|
||||
|
||||
extension JSONEncodable where Self: Encodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
extension QueryStringEncodable where Self: Encodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String {
|
||||
guard let data = try? codableHelper.jsonEncoder.encode(self) else {
|
||||
fatalError("Could not encode to json: \(self)")
|
||||
}
|
||||
return data.encodeToJSON(codableHelper: codableHelper)
|
||||
return data.encodeToQueryString(codableHelper: codableHelper)
|
||||
}
|
||||
}{{/useVapor}}{{#generateModelAdditionalProperties}}
|
||||
|
||||
|
@ -10,7 +10,7 @@ import Foundation
|
||||
import FoundationNetworking
|
||||
#endif
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct JSONDataEncoding {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct JSONDataEncoding: Sendable {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
@ -27,8 +27,8 @@ import FoundationNetworking
|
||||
/// - throws: An `Error` if the encoding process encounters an error.
|
||||
///
|
||||
/// - returns: The encoded request.
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) -> URLRequest {
|
||||
var urlRequest = urlRequest
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func encode(request: URLRequest, with parameters: [String: any Sendable]?) -> URLRequest {
|
||||
var urlRequest = request
|
||||
|
||||
guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else {
|
||||
return urlRequest
|
||||
@ -43,10 +43,10 @@ import FoundationNetworking
|
||||
return urlRequest
|
||||
}
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func encodingParameters(jsonData: Data?) -> [String: Any]? {
|
||||
var returnedParams: [String: Any]?
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func encodingParameters(jsonData: Data?) -> [String: any Sendable]? {
|
||||
var returnedParams: [String: any Sendable]?
|
||||
if let jsonData = jsonData, !jsonData.isEmpty {
|
||||
var params: [String: Any] = [:]
|
||||
var params: [String: any Sendable] = [:]
|
||||
params[jsonDataKey] = jsonData
|
||||
returnedParams = params
|
||||
}
|
||||
|
@ -9,8 +9,8 @@ import Foundation
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class JSONEncodingHelper {
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func encodingParameters<T: Encodable>(forEncodableObject encodableObj: T?, codableHelper: CodableHelper) -> [String: Any]? {
|
||||
var params: [String: Any]?
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func encodingParameters<T: Encodable>(forEncodableObject encodableObj: T?, codableHelper: CodableHelper) -> [String: any Sendable]? {
|
||||
var params: [String: any Sendable]?
|
||||
|
||||
// Encode the Encodable object
|
||||
if let encodableObj = encodableObj {
|
||||
@ -26,8 +26,8 @@ import Foundation
|
||||
return params
|
||||
}
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func encodingParameters(forEncodableObject encodableObj: Any?, codableHelper: CodableHelper) -> [String: Any]? {
|
||||
var params: [String: Any]?
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func encodingParameters(forEncodableObject encodableObj: Any?, codableHelper: CodableHelper) -> [String: any Sendable]? {
|
||||
var params: [String: any Sendable]?
|
||||
|
||||
if let encodableObj = encodableObj {
|
||||
do {
|
||||
|
@ -10,8 +10,8 @@ import FoundationNetworking
|
||||
#endif{{#useAlamofire}}
|
||||
import Alamofire{{/useAlamofire}}
|
||||
|
||||
protocol JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any
|
||||
protocol QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String
|
||||
}
|
||||
|
||||
/// An enum where the last case value can be used as a default catch-all.
|
||||
@ -119,9 +119,9 @@ extension Response : Sendable where T : Sendable {}{{#useAlamofire}}
|
||||
/// Type-erased ResponseSerializer
|
||||
///
|
||||
/// This is needed in order to use `ResponseSerializer` as a Type in `Configuration`. Obsolete with `any` keyword in Swift >= 5.7
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct AnyResponseSerializer<T>: ResponseSerializer {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct AnyResponseSerializer<T: Sendable>: ResponseSerializer {
|
||||
|
||||
let _serialize: (URLRequest?, HTTPURLResponse?, Data?, Error?) throws -> T
|
||||
let _serialize: @Sendable (URLRequest?, HTTPURLResponse?, Data?, Error?) throws -> T
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init<V: ResponseSerializer>(_ delegatee: V) where V.SerializedObject == T {
|
||||
_serialize = delegatee.serialize
|
||||
|
@ -76,8 +76,8 @@ import Foundation
|
||||
}
|
||||
}
|
||||
|
||||
extension OpenAPIDateWithoutTime: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
extension OpenAPIDateWithoutTime: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String {
|
||||
return OpenISO8601DateFormatter.withoutTime.string(from: self.normalizedWrappedDate())
|
||||
}
|
||||
}
|
||||
|
@ -25,8 +25,7 @@ let package = Package(
|
||||
dependencies: [
|
||||
// Dependencies declare other packages that this package depends on.
|
||||
{{#useAlamofire}}
|
||||
// TODO: Alamofire versions 5.10.0 and above are not currently supported. If you need a newer version, please consider submitting a Pull Request with the required changes.
|
||||
.package(url: "https://github.com/Alamofire/Alamofire", exact: "5.9.1"),
|
||||
.package(url: "https://github.com/Alamofire/Alamofire", exact: "5.10.2"),
|
||||
{{/useAlamofire}}
|
||||
{{#usePromiseKit}}
|
||||
.package(url: "https://github.com/mxcl/PromiseKit", .upToNextMajor(from: "8.1.2")),
|
||||
|
@ -27,8 +27,7 @@ Pod::Spec.new do |s|
|
||||
{{/podDocumentationURL}}
|
||||
s.source_files = '{{swiftPackagePath}}{{^swiftPackagePath}}{{#useSPMFileStructure}}Sources/{{projectName}}{{/useSPMFileStructure}}{{^useSPMFileStructure}}{{projectName}}/Classes{{/useSPMFileStructure}}{{/swiftPackagePath}}/**/*.swift'
|
||||
{{#useAlamofire}}
|
||||
# TODO: Alamofire versions 5.10.0 and above are not currently supported. If you need a newer version, please consider submitting a Pull Request with the required changes.
|
||||
s.dependency 'Alamofire', '5.9.1'
|
||||
s.dependency 'Alamofire', '5.10.2'
|
||||
{{/useAlamofire}}
|
||||
{{#usePromiseKit}}
|
||||
s.dependency 'PromiseKit/CorePromise', '~> 8.1'
|
||||
|
@ -1 +1 @@
|
||||
"{{baseName}}": {{#isQueryParam}}(wrappedValue: {{/isQueryParam}}{{paramName}}{{^required}}?{{/required}}.encodeToJSON(codableHelper: apiConfiguration.codableHelper){{#isQueryParam}}, isExplode: {{isExplode}}){{/isQueryParam}}
|
||||
"{{baseName}}": {{#isQueryParam}}(wrappedValue: {{/isQueryParam}}{{paramName}}{{^required}}?{{/required}}.encodeToQueryString(codableHelper: apiConfiguration.codableHelper){{#isQueryParam}}, isExplode: {{isExplode}}){{/isQueryParam}}
|
@ -295,7 +295,7 @@ extension {{projectName}}API {
|
||||
{{/bodyParam}}
|
||||
{{^bodyParam}}
|
||||
{{#hasFormParams}}
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
{{#formParams}}
|
||||
{{> _param}},
|
||||
{{/formParams}}
|
||||
@ -305,7 +305,7 @@ extension {{projectName}}API {
|
||||
let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters)
|
||||
{{/hasFormParams}}
|
||||
{{^hasFormParams}}
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
{{/hasFormParams}}
|
||||
{{/bodyParam}}{{#hasQueryParams}}
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
@ -316,7 +316,7 @@ extension {{projectName}}API {
|
||||
]){{/hasQueryParams}}{{^hasQueryParams}}
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString){{/hasQueryParams}}
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [{{^headerParams}}{{^hasFormParams}}{{^hasConsumes}}
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [{{^headerParams}}{{^hasFormParams}}{{^hasConsumes}}
|
||||
:{{/hasConsumes}}{{/hasFormParams}}{{/headerParams}}{{#hasFormParams}}
|
||||
"Content-Type": {{^consumes}}"multipart/form-data"{{/consumes}}{{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}},{{/hasFormParams}}{{^hasFormParams}}{{#hasConsumes}}
|
||||
"Content-Type": {{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}},{{/hasConsumes}}{{/hasFormParams}}{{#headerParams}}
|
||||
|
@ -28,7 +28,7 @@ fileprivate class AlamofireRequestBuilderConfiguration: @unchecked Sendable {
|
||||
}
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class AlamofireRequestBuilder<T>: RequestBuilder<T>, @unchecked Sendable {
|
||||
required {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared) {
|
||||
required {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared) {
|
||||
super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration)
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ fileprivate class AlamofireRequestBuilderConfiguration: @unchecked Sendable {
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
override {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(completion: @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) -> RequestTask {
|
||||
override {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(completion: @Sendable @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) -> RequestTask {
|
||||
let managerId = UUID().uuidString
|
||||
// Create a new manager for each request to customize its request header
|
||||
let manager = createAlamofireSession()
|
||||
@ -163,12 +163,12 @@ fileprivate class AlamofireRequestBuilderConfiguration: @unchecked Sendable {
|
||||
return requestTask
|
||||
}
|
||||
|
||||
fileprivate func processRequest(request: DataRequest, managerId: String, completion: @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) {
|
||||
fileprivate func processRequest(request: DataRequest, managerId: String, completion: @Sendable @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) {
|
||||
if let credential = self.credential {
|
||||
request.authenticate(with: credential)
|
||||
}
|
||||
|
||||
let cleanupRequest = {
|
||||
let cleanupRequest = { @Sendable in
|
||||
AlamofireRequestBuilderConfiguration.shared.managerStore[managerId] = nil
|
||||
}
|
||||
|
||||
@ -257,12 +257,12 @@ fileprivate class AlamofireRequestBuilderConfiguration: @unchecked Sendable {
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class AlamofireDecodableRequestBuilder<T: Decodable>: AlamofireRequestBuilder<T>, @unchecked Sendable {
|
||||
|
||||
override fileprivate func processRequest(request: DataRequest, managerId: String, completion: @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) {
|
||||
override fileprivate func processRequest(request: DataRequest, managerId: String, completion: @Sendable @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) {
|
||||
if let credential = self.credential {
|
||||
request.authenticate(with: credential)
|
||||
}
|
||||
|
||||
let cleanupRequest = {
|
||||
let cleanupRequest = { @Sendable in
|
||||
AlamofireRequestBuilderConfiguration.shared.managerStore[managerId] = nil
|
||||
}
|
||||
|
||||
@ -415,6 +415,6 @@ extension JSONDataEncoding: ParameterEncoding {
|
||||
public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest {
|
||||
let urlRequest = try urlRequest.asURLRequest()
|
||||
|
||||
return encode(urlRequest, with: parameters)
|
||||
return encode(request: urlRequest, with: parameters)
|
||||
}
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable {
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class URLSessionRequestBuilder<T>: RequestBuilder<T>, @unchecked Sendable {
|
||||
|
||||
required {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared) {
|
||||
required {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared) {
|
||||
super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration)
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable {
|
||||
originalRequest.setValue(value, forHTTPHeaderField: key)
|
||||
}
|
||||
|
||||
let modifiedRequest = try encoding.encode(originalRequest, with: parameters)
|
||||
let modifiedRequest = try encoding.encode(request: originalRequest, with: parameters)
|
||||
|
||||
return modifiedRequest
|
||||
}
|
||||
@ -431,13 +431,13 @@ fileprivate final class SessionDelegate: NSObject, URLSessionTaskDelegate {
|
||||
}
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} protocol ParameterEncoding {
|
||||
func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest
|
||||
func encode(request: URLRequest, with parameters: [String: any Sendable]?) throws -> URLRequest
|
||||
}
|
||||
|
||||
private class URLEncoding: ParameterEncoding {
|
||||
func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest {
|
||||
func encode(request: URLRequest, with parameters: [String: any Sendable]?) throws -> URLRequest {
|
||||
|
||||
var urlRequest = urlRequest
|
||||
var urlRequest = request
|
||||
|
||||
guard let parameters = parameters else { return urlRequest }
|
||||
|
||||
@ -462,9 +462,9 @@ private class FormDataEncoding: ParameterEncoding {
|
||||
self.contentTypeForFormPart = contentTypeForFormPart
|
||||
}
|
||||
|
||||
func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest {
|
||||
func encode(request: URLRequest, with parameters: [String: any Sendable]?) throws -> URLRequest {
|
||||
|
||||
var urlRequest = urlRequest
|
||||
var urlRequest = request
|
||||
|
||||
guard let parameters = parameters, !parameters.isEmpty else {
|
||||
return urlRequest
|
||||
@ -631,9 +631,9 @@ private class FormDataEncoding: ParameterEncoding {
|
||||
}
|
||||
|
||||
private class FormURLEncoding: ParameterEncoding {
|
||||
func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest {
|
||||
func encode(request: URLRequest, with parameters: [String: any Sendable]?) throws -> URLRequest {
|
||||
|
||||
var urlRequest = urlRequest
|
||||
var urlRequest = request
|
||||
|
||||
var requestBodyComponents = URLComponents()
|
||||
let queryItems = APIHelper.mapValuesToQueryItems(parameters ?? [:])
|
||||
@ -661,9 +661,9 @@ private class FormURLEncoding: ParameterEncoding {
|
||||
}
|
||||
|
||||
private class OctetStreamEncoding: ParameterEncoding {
|
||||
func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest {
|
||||
func encode(request: URLRequest, with parameters: [String: any Sendable]?) throws -> URLRequest {
|
||||
|
||||
var urlRequest = urlRequest
|
||||
var urlRequest = request
|
||||
|
||||
guard let body = parameters?["body"] else { return urlRequest }
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{dataType}}, Sendable, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{^isString}}{{^isInteger}}{{^isFloat}}{{^isDouble}}, JSONEncodable{{/isDouble}}{{/isFloat}}{{/isInteger}}{{/isString}}{{/useVapor}}, CaseIterable{{#enumUnknownDefaultCase}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{/enumUnknownDefaultCase}} {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{dataType}}, Sendable, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{^isString}}{{^isInteger}}{{^isFloat}}{{^isDouble}}, QueryStringEncodable{{/isDouble}}{{/isFloat}}{{/isInteger}}{{/isString}}{{/useVapor}}, CaseIterable{{#enumUnknownDefaultCase}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{/enumUnknownDefaultCase}} {
|
||||
{{#allowableValues}}
|
||||
{{#enumVars}}
|
||||
case {{{name}}} = {{{value}}}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, Sendable, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{^isContainer}}{{^isString}}{{^isInteger}}{{^isFloat}}{{^isDouble}}, JSONEncodable{{/isDouble}}{{/isFloat}}{{/isInteger}}{{/isString}}{{/isContainer}}{{/useVapor}}, CaseIterable{{#enumUnknownDefaultCase}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{#isContainer}}, CaseIterableDefaultsLast{{/isContainer}}{{/enumUnknownDefaultCase}} {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, Sendable, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{^isContainer}}{{^isString}}{{^isInteger}}{{^isFloat}}{{^isDouble}}, QueryStringEncodable{{/isDouble}}{{/isFloat}}{{/isInteger}}{{/isString}}{{/isContainer}}{{/useVapor}}, CaseIterable{{#enumUnknownDefaultCase}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{#isContainer}}, CaseIterableDefaultsLast{{/isContainer}}{{/enumUnknownDefaultCase}} {
|
||||
{{#allowableValues}}
|
||||
{{#enumVars}}
|
||||
case {{{name}}} = {{{value}}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{{^objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#useClasses}}final class{{/useClasses}}{{^useClasses}}struct{{/useClasses}} {{{classname}}}: {{^useClasses}}Sendable, {{/useClasses}}{{#useClasses}}{{#readonlyProperties}}@unchecked Sendable, {{/readonlyProperties}}{{/useClasses}}{{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable{{#useJsonEncodable}}, JSONEncodable{{/useJsonEncodable}}{{/useVapor}}{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}} {
|
||||
{{/objcCompatible}}{{#objcCompatible}}@objcMembers {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} class {{classname}}: NSObject, Codable{{#useJsonEncodable}}, JSONEncodable{{/useJsonEncodable}} {
|
||||
{{^objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#useClasses}}final class{{/useClasses}}{{^useClasses}}struct{{/useClasses}} {{{classname}}}: {{^useClasses}}Sendable, {{/useClasses}}{{#useClasses}}{{#readonlyProperties}}@unchecked Sendable, {{/readonlyProperties}}{{/useClasses}}{{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable{{#useJsonEncodable}}, QueryStringEncodable{{/useJsonEncodable}}{{/useVapor}}{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}} {
|
||||
{{/objcCompatible}}{{#objcCompatible}}@objcMembers {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} class {{classname}}: NSObject, Codable{{#useJsonEncodable}}, QueryStringEncodable{{/useJsonEncodable}} {
|
||||
{{/objcCompatible}}
|
||||
|
||||
{{#allVars}}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{^useClasses}}Sendable, {{/useClasses}}{{#useClasses}}{{#readonlyProperties}}Sendable, {{/readonlyProperties}}{{/useClasses}}{{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable, JSONEncodable{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}}{{/useVapor}} {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{^useClasses}}Sendable, {{/useClasses}}{{#useClasses}}{{#readonlyProperties}}Sendable, {{/readonlyProperties}}{{/useClasses}}{{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable, QueryStringEncodable{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}}{{/useVapor}} {
|
||||
{{#oneOf}}
|
||||
case type{{#transformArrayType}}{{.}}{{/transformArrayType}}({{.}})
|
||||
{{/oneOf}}
|
||||
|
@ -1,2 +1 @@
|
||||
# TODO: Alamofire versions 5.10.0 and above are not currently supported. If you need a newer version, please consider submitting a Pull Request with the required changes.
|
||||
github "Alamofire/Alamofire" = 5.9.1
|
||||
github "Alamofire/Alamofire" = 5.10.2
|
||||
|
@ -1,13 +1,13 @@
|
||||
{
|
||||
"originHash" : "82fa799fdb0b54d09f6eef7da70838721a3b0d69ea8499c89924e55e07e47110",
|
||||
"originHash" : "d2e45fa99287c9c1d71d047aa90c9675d5c0aee0e8ba334a9517cdbbfc12f90f",
|
||||
"pins" : [
|
||||
{
|
||||
"identity" : "alamofire",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/Alamofire/Alamofire",
|
||||
"state" : {
|
||||
"revision" : "f455c2975872ccd2d9c81594c658af65716e9b9a",
|
||||
"version" : "5.9.1"
|
||||
"revision" : "513364f870f6bfc468f9d2ff0a95caccc10044c5",
|
||||
"version" : "5.10.2"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -19,8 +19,7 @@ let package = Package(
|
||||
],
|
||||
dependencies: [
|
||||
// Dependencies declare other packages that this package depends on.
|
||||
// TODO: Alamofire versions 5.10.0 and above are not currently supported. If you need a newer version, please consider submitting a Pull Request with the required changes.
|
||||
.package(url: "https://github.com/Alamofire/Alamofire", exact: "5.9.1"),
|
||||
.package(url: "https://github.com/Alamofire/Alamofire", exact: "5.10.2"),
|
||||
],
|
||||
targets: [
|
||||
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
|
||||
|
@ -11,6 +11,5 @@ Pod::Spec.new do |s|
|
||||
s.homepage = 'https://github.com/openapitools/openapi-generator'
|
||||
s.summary = 'PetstoreClient'
|
||||
s.source_files = 'Sources/PetstoreClient/**/*.swift'
|
||||
# TODO: Alamofire versions 5.10.0 and above are not currently supported. If you need a newer version, please consider submitting a Pull Request with the required changes.
|
||||
s.dependency 'Alamofire', '5.9.1'
|
||||
s.dependency 'Alamofire', '5.10.2'
|
||||
end
|
||||
|
@ -43,7 +43,7 @@ open class AnotherFakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/json",
|
||||
]
|
||||
|
||||
|
@ -41,7 +41,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -84,7 +84,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -127,7 +127,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -170,7 +170,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -213,7 +213,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/json",
|
||||
]
|
||||
|
||||
@ -257,10 +257,10 @@ open class FakeAPI {
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"query": (wrappedValue: query.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"query": (wrappedValue: query.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/json",
|
||||
]
|
||||
|
||||
@ -305,7 +305,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/json",
|
||||
]
|
||||
|
||||
@ -375,21 +375,21 @@ open class FakeAPI {
|
||||
open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: OpenAPIDateWithoutTime? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) -> RequestBuilder<Void> {
|
||||
let localVariablePath = "/fake"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"integer": integer?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"int32": int32?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"int64": int64?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"number": number.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"float": float?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"double": double.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"string": string?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"pattern_without_delimiter": patternWithoutDelimiter.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"byte": byte.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"binary": binary?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"date": date?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"dateTime": dateTime?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"password": password?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"callback": callback?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
"integer": integer?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"int32": int32?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"int64": int64?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"number": number.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"float": float?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"double": double.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"string": string?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"pattern_without_delimiter": patternWithoutDelimiter.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"byte": byte.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"binary": binary?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"date": date?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"dateTime": dateTime?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"password": password?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
@ -397,7 +397,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
]
|
||||
|
||||
@ -519,9 +519,9 @@ open class FakeAPI {
|
||||
open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) -> RequestBuilder<Void> {
|
||||
let localVariablePath = "/fake"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"enum_form_string_array": enumFormStringArray?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"enum_form_string": enumFormString?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
"enum_form_string_array": enumFormStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
@ -529,16 +529,16 @@ open class FakeAPI {
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"enum_query_string_array": (wrappedValue: enumQueryStringArray?.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"enum_query_string": (wrappedValue: enumQueryString?.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"enum_query_integer": (wrappedValue: enumQueryInteger?.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"enum_query_double": (wrappedValue: enumQueryDouble?.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"enum_query_string_array": (wrappedValue: enumQueryStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"enum_query_string": (wrappedValue: enumQueryString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"enum_query_integer": (wrappedValue: enumQueryInteger?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"enum_query_double": (wrappedValue: enumQueryDouble?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
"enum_header_string_array": enumHeaderStringArray?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"enum_header_string": enumHeaderString?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"enum_header_string_array": enumHeaderStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"enum_header_string": enumHeaderString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
@ -588,19 +588,19 @@ open class FakeAPI {
|
||||
open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) -> RequestBuilder<Void> {
|
||||
let localVariablePath = "/fake"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"required_string_group": (wrappedValue: requiredStringGroup.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"required_int64_group": (wrappedValue: requiredInt64Group.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"string_group": (wrappedValue: stringGroup?.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"int64_group": (wrappedValue: int64Group?.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"required_string_group": (wrappedValue: requiredStringGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"required_int64_group": (wrappedValue: requiredInt64Group.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"string_group": (wrappedValue: stringGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"int64_group": (wrappedValue: int64Group?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
"required_boolean_group": requiredBooleanGroup.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"boolean_group": booleanGroup?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"required_boolean_group": requiredBooleanGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"boolean_group": booleanGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
@ -643,7 +643,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/json",
|
||||
]
|
||||
|
||||
@ -685,9 +685,9 @@ open class FakeAPI {
|
||||
open class func testJsonFormDataWithRequestBuilder(param: String, param2: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) -> RequestBuilder<Void> {
|
||||
let localVariablePath = "/fake/jsonFormData"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"param": param.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"param2": param2.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
"param": param.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
@ -695,7 +695,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
]
|
||||
|
||||
|
@ -46,7 +46,7 @@ open class FakeClassnameTags123API {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/json",
|
||||
]
|
||||
|
||||
|
@ -48,7 +48,7 @@ open class PetAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/json",
|
||||
]
|
||||
|
||||
@ -96,12 +96,12 @@ open class PetAPI {
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
"api_key": apiKey?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"api_key": apiKey?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
@ -153,14 +153,14 @@ open class PetAPI {
|
||||
open class func findPetsByStatusWithRequestBuilder(status: [Status_findPetsByStatus], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) -> RequestBuilder<[Pet]> {
|
||||
let localVariablePath = "/pet/findByStatus"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"status": (wrappedValue: status.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"status": (wrappedValue: status.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -206,14 +206,14 @@ open class PetAPI {
|
||||
open class func findPetsByTagsWithRequestBuilder(tags: [String], apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) -> RequestBuilder<[Pet]> {
|
||||
let localVariablePath = "/pet/findByTags"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"tags": (wrappedValue: tags.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"tags": (wrappedValue: tags.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -260,11 +260,11 @@ open class PetAPI {
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -311,7 +311,7 @@ open class PetAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/json",
|
||||
]
|
||||
|
||||
@ -361,9 +361,9 @@ open class PetAPI {
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"name": name?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"status": status?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
"name": name?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
@ -371,7 +371,7 @@ open class PetAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
]
|
||||
|
||||
@ -421,9 +421,9 @@ open class PetAPI {
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"additionalMetadata": additionalMetadata?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"file": file?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
"additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
@ -431,7 +431,7 @@ open class PetAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "multipart/form-data",
|
||||
]
|
||||
|
||||
@ -481,9 +481,9 @@ open class PetAPI {
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"additionalMetadata": additionalMetadata?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"requiredFile": requiredFile.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
"additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
@ -491,7 +491,7 @@ open class PetAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "multipart/form-data",
|
||||
]
|
||||
|
||||
|
@ -42,11 +42,11 @@ open class StoreAPI {
|
||||
let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -88,11 +88,11 @@ open class StoreAPI {
|
||||
open class func getInventoryWithRequestBuilder(apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) -> RequestBuilder<[String: Int]> {
|
||||
let localVariablePath = "/store/inventory"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -136,11 +136,11 @@ open class StoreAPI {
|
||||
let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -184,7 +184,7 @@ open class StoreAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
|
@ -43,7 +43,7 @@ open class UserAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -87,7 +87,7 @@ open class UserAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -131,7 +131,7 @@ open class UserAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -175,11 +175,11 @@ open class UserAPI {
|
||||
let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -222,11 +222,11 @@ open class UserAPI {
|
||||
let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -269,15 +269,15 @@ open class UserAPI {
|
||||
open class func loginUserWithRequestBuilder(username: String, password: String, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) -> RequestBuilder<String> {
|
||||
let localVariablePath = "/user/login"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"username": (wrappedValue: username.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"password": (wrappedValue: password.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"username": (wrappedValue: username.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"password": (wrappedValue: password.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -315,11 +315,11 @@ open class UserAPI {
|
||||
open class func logoutUserWithRequestBuilder(apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) -> RequestBuilder<Void> {
|
||||
let localVariablePath = "/user/logout"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -369,7 +369,7 @@ open class UserAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
|
@ -7,8 +7,8 @@
|
||||
import Foundation
|
||||
|
||||
public struct APIHelper {
|
||||
public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? {
|
||||
let destination = source.reduce(into: [String: Any]()) { result, item in
|
||||
public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? {
|
||||
let destination = source.reduce(into: [String: any Sendable]()) { result, item in
|
||||
if let value = item.value {
|
||||
result[item.key] = value
|
||||
}
|
||||
@ -20,7 +20,7 @@ public struct APIHelper {
|
||||
return destination
|
||||
}
|
||||
|
||||
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
|
||||
public static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] {
|
||||
return source.reduce(into: [String: String]()) { result, item in
|
||||
if let collection = item.value as? [Any?] {
|
||||
result[item.key] = collection
|
||||
@ -32,12 +32,12 @@ public struct APIHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? {
|
||||
public static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? {
|
||||
guard let source = source else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return source.reduce(into: [String: Any]()) { result, item in
|
||||
return source.reduce(into: [String: any Sendable]()) { result, item in
|
||||
switch item.value {
|
||||
case let x as Bool:
|
||||
result[item.key] = x.description
|
||||
@ -99,7 +99,7 @@ public struct APIHelper {
|
||||
/// maps all values from source to query parameters
|
||||
///
|
||||
/// collection values are always exploded
|
||||
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
|
||||
public static func mapValuesToQueryItems(_ source: [String: (any Sendable)?]) -> [URLQueryItem]? {
|
||||
let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in
|
||||
if let collection = item.value as? [Any?] {
|
||||
collection
|
||||
|
@ -64,7 +64,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable {
|
||||
open class RequestBuilder<T>: @unchecked Sendable {
|
||||
public var credential: URLCredential?
|
||||
public var headers: [String: String]
|
||||
public let parameters: [String: Any]?
|
||||
public let parameters: [String: any Sendable]?
|
||||
public let method: String
|
||||
public let URLString: String
|
||||
public let requestTask: RequestTask = RequestTask()
|
||||
@ -74,7 +74,7 @@ open class RequestBuilder<T>: @unchecked Sendable {
|
||||
/// Optional block to obtain a reference to the request's progress instance when available.
|
||||
public var onProgressReady: ((Progress) -> Void)?
|
||||
|
||||
required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) {
|
||||
required public init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) {
|
||||
self.method = method
|
||||
self.URLString = URLString
|
||||
self.parameters = parameters
|
||||
|
@ -28,7 +28,7 @@ fileprivate class AlamofireRequestBuilderConfiguration: @unchecked Sendable {
|
||||
}
|
||||
|
||||
open class AlamofireRequestBuilder<T>: RequestBuilder<T>, @unchecked Sendable {
|
||||
required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) {
|
||||
required public init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) {
|
||||
super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration)
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T>, @unchecked Sendable {
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
override open func execute(completion: @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) -> RequestTask {
|
||||
override open func execute(completion: @Sendable @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) -> RequestTask {
|
||||
let managerId = UUID().uuidString
|
||||
// Create a new manager for each request to customize its request header
|
||||
let manager = createAlamofireSession()
|
||||
@ -163,12 +163,12 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T>, @unchecked Sendable {
|
||||
return requestTask
|
||||
}
|
||||
|
||||
fileprivate func processRequest(request: DataRequest, managerId: String, completion: @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) {
|
||||
fileprivate func processRequest(request: DataRequest, managerId: String, completion: @Sendable @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) {
|
||||
if let credential = self.credential {
|
||||
request.authenticate(with: credential)
|
||||
}
|
||||
|
||||
let cleanupRequest = {
|
||||
let cleanupRequest = { @Sendable in
|
||||
AlamofireRequestBuilderConfiguration.shared.managerStore[managerId] = nil
|
||||
}
|
||||
|
||||
@ -257,12 +257,12 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T>, @unchecked Sendable {
|
||||
|
||||
open class AlamofireDecodableRequestBuilder<T: Decodable>: AlamofireRequestBuilder<T>, @unchecked Sendable {
|
||||
|
||||
override fileprivate func processRequest(request: DataRequest, managerId: String, completion: @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) {
|
||||
override fileprivate func processRequest(request: DataRequest, managerId: String, completion: @Sendable @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) {
|
||||
if let credential = self.credential {
|
||||
request.authenticate(with: credential)
|
||||
}
|
||||
|
||||
let cleanupRequest = {
|
||||
let cleanupRequest = { @Sendable in
|
||||
AlamofireRequestBuilderConfiguration.shared.managerStore[managerId] = nil
|
||||
}
|
||||
|
||||
@ -415,6 +415,6 @@ extension JSONDataEncoding: ParameterEncoding {
|
||||
public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest {
|
||||
let urlRequest = try urlRequest.asURLRequest()
|
||||
|
||||
return encode(urlRequest, with: parameters)
|
||||
return encode(request: urlRequest, with: parameters)
|
||||
}
|
||||
}
|
||||
|
@ -9,73 +9,49 @@ import Foundation
|
||||
import FoundationNetworking
|
||||
#endif
|
||||
|
||||
extension Bool: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
extension Bool: QueryStringEncodable {}
|
||||
extension Float: QueryStringEncodable {}
|
||||
extension Int: QueryStringEncodable {}
|
||||
extension Int32: QueryStringEncodable {}
|
||||
extension Int64: QueryStringEncodable {}
|
||||
extension Double: QueryStringEncodable {}
|
||||
extension Decimal: QueryStringEncodable {}
|
||||
extension String: QueryStringEncodable {}
|
||||
extension URL: QueryStringEncodable {}
|
||||
extension UUID: QueryStringEncodable {}
|
||||
|
||||
extension QueryStringEncodable {
|
||||
@_disfavoredOverload
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) }
|
||||
}
|
||||
|
||||
extension Float: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
extension RawRepresentable where RawValue: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) }
|
||||
}
|
||||
|
||||
extension Int: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension Int32: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension Int64: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension Double: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension Decimal: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension String: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension URL: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension UUID: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension RawRepresentable where RawValue: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { return self.rawValue }
|
||||
}
|
||||
|
||||
private func encodeIfPossible<T>(_ object: T, codableHelper: CodableHelper) -> Any {
|
||||
if let encodableObject = object as? JSONEncodable {
|
||||
return encodableObject.encodeToJSON(codableHelper: codableHelper)
|
||||
private func encodeIfPossible<T>(_ object: T, codableHelper: CodableHelper) -> String {
|
||||
if let encodableObject = object as? QueryStringEncodable {
|
||||
return encodableObject.encodeToQueryString(codableHelper: codableHelper)
|
||||
} else {
|
||||
return object
|
||||
return String(describing: object)
|
||||
}
|
||||
}
|
||||
|
||||
extension Array: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
extension Array {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> [String] {
|
||||
return self.map { encodeIfPossible($0, codableHelper: codableHelper) }
|
||||
}
|
||||
}
|
||||
|
||||
extension Set: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
return Array(self).encodeToJSON(codableHelper: codableHelper)
|
||||
extension Set {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> [String] {
|
||||
return Array(self).encodeToQueryString(codableHelper: codableHelper)
|
||||
}
|
||||
}
|
||||
|
||||
extension Dictionary: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
var dictionary = [AnyHashable: Any]()
|
||||
extension Dictionary {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> [Key: String] {
|
||||
var dictionary = [Key: String]()
|
||||
for (key, value) in self {
|
||||
dictionary[key] = encodeIfPossible(value, codableHelper: codableHelper)
|
||||
}
|
||||
@ -83,24 +59,24 @@ extension Dictionary: JSONEncodable {
|
||||
}
|
||||
}
|
||||
|
||||
extension Data: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
extension Data: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String {
|
||||
return self.base64EncodedString(options: Data.Base64EncodingOptions())
|
||||
}
|
||||
}
|
||||
|
||||
extension Date: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
extension Date: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String {
|
||||
return codableHelper.dateFormatter.string(from: self)
|
||||
}
|
||||
}
|
||||
|
||||
extension JSONEncodable where Self: Encodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
extension QueryStringEncodable where Self: Encodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String {
|
||||
guard let data = try? codableHelper.jsonEncoder.encode(self) else {
|
||||
fatalError("Could not encode to json: \(self)")
|
||||
}
|
||||
return data.encodeToJSON(codableHelper: codableHelper)
|
||||
return data.encodeToQueryString(codableHelper: codableHelper)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ import Foundation
|
||||
import FoundationNetworking
|
||||
#endif
|
||||
|
||||
public struct JSONDataEncoding {
|
||||
public struct JSONDataEncoding: Sendable {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
@ -27,8 +27,8 @@ public struct JSONDataEncoding {
|
||||
/// - throws: An `Error` if the encoding process encounters an error.
|
||||
///
|
||||
/// - returns: The encoded request.
|
||||
public func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) -> URLRequest {
|
||||
var urlRequest = urlRequest
|
||||
public func encode(request: URLRequest, with parameters: [String: any Sendable]?) -> URLRequest {
|
||||
var urlRequest = request
|
||||
|
||||
guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else {
|
||||
return urlRequest
|
||||
@ -43,10 +43,10 @@ public struct JSONDataEncoding {
|
||||
return urlRequest
|
||||
}
|
||||
|
||||
public static func encodingParameters(jsonData: Data?) -> [String: Any]? {
|
||||
var returnedParams: [String: Any]?
|
||||
public static func encodingParameters(jsonData: Data?) -> [String: any Sendable]? {
|
||||
var returnedParams: [String: any Sendable]?
|
||||
if let jsonData = jsonData, !jsonData.isEmpty {
|
||||
var params: [String: Any] = [:]
|
||||
var params: [String: any Sendable] = [:]
|
||||
params[jsonDataKey] = jsonData
|
||||
returnedParams = params
|
||||
}
|
||||
|
@ -9,8 +9,8 @@ import Foundation
|
||||
|
||||
open class JSONEncodingHelper {
|
||||
|
||||
open class func encodingParameters<T: Encodable>(forEncodableObject encodableObj: T?, codableHelper: CodableHelper) -> [String: Any]? {
|
||||
var params: [String: Any]?
|
||||
open class func encodingParameters<T: Encodable>(forEncodableObject encodableObj: T?, codableHelper: CodableHelper) -> [String: any Sendable]? {
|
||||
var params: [String: any Sendable]?
|
||||
|
||||
// Encode the Encodable object
|
||||
if let encodableObj = encodableObj {
|
||||
@ -26,8 +26,8 @@ open class JSONEncodingHelper {
|
||||
return params
|
||||
}
|
||||
|
||||
open class func encodingParameters(forEncodableObject encodableObj: Any?, codableHelper: CodableHelper) -> [String: Any]? {
|
||||
var params: [String: Any]?
|
||||
open class func encodingParameters(forEncodableObject encodableObj: Any?, codableHelper: CodableHelper) -> [String: any Sendable]? {
|
||||
var params: [String: any Sendable]?
|
||||
|
||||
if let encodableObj = encodableObj {
|
||||
do {
|
||||
|
@ -10,8 +10,8 @@ import FoundationNetworking
|
||||
#endif
|
||||
import Alamofire
|
||||
|
||||
protocol JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any
|
||||
protocol QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String
|
||||
}
|
||||
|
||||
/// An enum where the last case value can be used as a default catch-all.
|
||||
@ -119,9 +119,9 @@ extension Response : Sendable where T : Sendable {}
|
||||
/// Type-erased ResponseSerializer
|
||||
///
|
||||
/// This is needed in order to use `ResponseSerializer` as a Type in `Configuration`. Obsolete with `any` keyword in Swift >= 5.7
|
||||
public struct AnyResponseSerializer<T>: ResponseSerializer {
|
||||
public struct AnyResponseSerializer<T: Sendable>: ResponseSerializer {
|
||||
|
||||
let _serialize: (URLRequest?, HTTPURLResponse?, Data?, Error?) throws -> T
|
||||
let _serialize: @Sendable (URLRequest?, HTTPURLResponse?, Data?, Error?) throws -> T
|
||||
|
||||
public init<V: ResponseSerializer>(_ delegatee: V) where V.SerializedObject == T {
|
||||
_serialize = delegatee.serialize
|
||||
|
@ -76,8 +76,8 @@ public struct OpenAPIDateWithoutTime: Sendable, Codable, Hashable, Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
extension OpenAPIDateWithoutTime: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
extension OpenAPIDateWithoutTime: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String {
|
||||
return OpenISO8601DateFormatter.withoutTime.string(from: self.normalizedWrappedDate())
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct AdditionalPropertiesClass: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct AdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var mapString: [String: String]?
|
||||
public var mapMapString: [String: [String: String]]?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Animal: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct Animal: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ApiResponse: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct ApiResponse: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var code: Int?
|
||||
public var type: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var arrayArrayNumber: [[Double]]?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayOfNumberOnly: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct ArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var arrayNumber: [Double]?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayTest: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct ArrayTest: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var arrayOfString: [String]?
|
||||
public var arrayArrayOfInteger: [[Int64]]?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Capitalization: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct Capitalization: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var smallCamel: String?
|
||||
public var capitalCamel: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Cat: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct Cat: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Category: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct Category: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var id: Int64?
|
||||
public var name: String? = "default-name"
|
||||
|
@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
|
||||
/** Model for testing model with \"_class\" property */
|
||||
public struct ClassModel: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct ClassModel: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var _class: String?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Client: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct Client: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var client: String?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Dog: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct Dog: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct EnumArrays: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct EnumArrays: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public enum JustSymbol: String, Sendable, Codable, CaseIterable {
|
||||
case greaterThanOrEqualTo = ">="
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct EnumTest: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct EnumTest: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public enum EnumString: String, Sendable, Codable, CaseIterable {
|
||||
case upper = "UPPER"
|
||||
|
@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
|
||||
/** Must be named `File` for test. */
|
||||
public struct File: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct File: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
/** Test capitalization */
|
||||
public var sourceURI: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct FileSchemaTestClass: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct FileSchemaTestClass: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var file: File?
|
||||
public var files: [File]?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct FormatTest: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct FormatTest: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public static let integerRule = NumericRule<Int>(minimum: 10, exclusiveMinimum: false, maximum: 100, exclusiveMaximum: false, multipleOf: nil)
|
||||
public static let int32Rule = NumericRule<Int>(minimum: 20, exclusiveMinimum: false, maximum: 200, exclusiveMaximum: false, multipleOf: nil)
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct HasOnlyReadOnly: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct HasOnlyReadOnly: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var bar: String?
|
||||
public var foo: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct List: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct List: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var _123list: String?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct MapTest: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct MapTest: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public enum MapOfEnumString: String, Sendable, Codable, CaseIterable {
|
||||
case upper = "UPPER"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var uuid: UUID?
|
||||
public var dateTime: Date?
|
||||
|
@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
|
||||
/** Model for testing model name starting with number */
|
||||
public struct Model200Response: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct Model200Response: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var name: Int?
|
||||
public var _class: String?
|
||||
|
@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
|
||||
/** Model for testing model name same as property name */
|
||||
public struct Name: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct Name: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var name: Int
|
||||
public var snakeCase: NullEncodable<Int> = .encodeValue(11033)
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct NumberOnly: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct NumberOnly: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var justNumber: Double?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Order: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct Order: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public enum Status: String, Sendable, Codable, CaseIterable {
|
||||
case placed = "placed"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct OuterComposite: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct OuterComposite: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var myNumber: Double?
|
||||
public var myString: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Pet: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct Pet: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public enum Status: String, Sendable, Codable, CaseIterable {
|
||||
case available = "available"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ReadOnlyFirst: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct ReadOnlyFirst: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var bar: String?
|
||||
public var baz: String?
|
||||
|
@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
|
||||
/** Model for testing reserved words */
|
||||
public struct Return: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct Return: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var _return: Int?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct SpecialModelName: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct SpecialModelName: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var specialPropertyName: Int64?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct StringBooleanMap: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct StringBooleanMap: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
|
||||
public enum CodingKeys: CodingKey, CaseIterable {
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Tag: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct Tag: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var id: Int64?
|
||||
public var name: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct TypeHolderDefault: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct TypeHolderDefault: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var stringItem: String = "what"
|
||||
public var numberItem: Double
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct TypeHolderExample: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct TypeHolderExample: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var stringItem: String
|
||||
public var numberItem: Double
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct User: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct User: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var id: Int64?
|
||||
public var username: String?
|
||||
|
@ -1,13 +1,13 @@
|
||||
{
|
||||
"originHash" : "6fb5b6bfc406365339fcc9d8236adab4f0b7ee38fc666a0f00b4b3b75beb7900",
|
||||
"originHash" : "d2e45fa99287c9c1d71d047aa90c9675d5c0aee0e8ba334a9517cdbbfc12f90f",
|
||||
"pins" : [
|
||||
{
|
||||
"identity" : "alamofire",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/Alamofire/Alamofire",
|
||||
"state" : {
|
||||
"revision" : "f455c2975872ccd2d9c81594c658af65716e9b9a",
|
||||
"version" : "5.9.1"
|
||||
"revision" : "513364f870f6bfc468f9d2ff0a95caccc10044c5",
|
||||
"version" : "5.10.2"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -27,7 +27,7 @@ class DateFormatTests: XCTestCase {
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
func testEncodeToJSONAlwaysResultsInUTCEncodedDate() {
|
||||
func testencodeToQueryStringAlwaysResultsInUTCEncodedDate() {
|
||||
var dateComponents = DateComponents()
|
||||
dateComponents.calendar = Calendar(identifier: .gregorian)
|
||||
dateComponents.year = 2018
|
||||
@ -47,7 +47,7 @@ class DateFormatTests: XCTestCase {
|
||||
return
|
||||
}
|
||||
|
||||
var encodedDate = utcDate.encodeToJSON(codableHelper: PetstoreClientAPIConfiguration.shared.codableHelper) as! String
|
||||
var encodedDate = utcDate.encodeToQueryString(codableHelper: PetstoreClientAPIConfiguration.shared.codableHelper) as! String
|
||||
XCTAssert(encodedDate.hasSuffix("Z"))
|
||||
|
||||
// test with a positive timzone offset from UTC
|
||||
@ -59,7 +59,7 @@ class DateFormatTests: XCTestCase {
|
||||
return
|
||||
}
|
||||
|
||||
encodedDate = nonUTCDate1.encodeToJSON(codableHelper: PetstoreClientAPIConfiguration.shared.codableHelper) as! String
|
||||
encodedDate = nonUTCDate1.encodeToQueryString(codableHelper: PetstoreClientAPIConfiguration.shared.codableHelper) as! String
|
||||
XCTAssert(encodedDate.hasSuffix("Z"))
|
||||
|
||||
// test with a negative timzone offset from UTC
|
||||
@ -71,7 +71,7 @@ class DateFormatTests: XCTestCase {
|
||||
return
|
||||
}
|
||||
|
||||
encodedDate = nonUTCDate2.encodeToJSON(codableHelper: PetstoreClientAPIConfiguration.shared.codableHelper) as! String
|
||||
encodedDate = nonUTCDate2.encodeToQueryString(codableHelper: PetstoreClientAPIConfiguration.shared.codableHelper) as! String
|
||||
XCTAssert(encodedDate.hasSuffix("Z"))
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
# TODO: Alamofire versions 5.10.0 and above are not currently supported. If you need a newer version, please consider submitting a Pull Request with the required changes.
|
||||
github "Alamofire/Alamofire" = 5.9.1
|
||||
github "Alamofire/Alamofire" = 5.10.2
|
||||
github "mxcl/PromiseKit" ~> 8.1
|
||||
github "ReactiveX/RxSwift" ~> 6.8
|
||||
|
@ -1,13 +1,13 @@
|
||||
{
|
||||
"originHash" : "766b7b8894983c692454ee57aad3d618580bf90078cad51008d129ddf41ff945",
|
||||
"originHash" : "271b0c60e4f6d7e4e95b242fe75853812e17a2a3c7fd43e160c0d750e9489a83",
|
||||
"pins" : [
|
||||
{
|
||||
"identity" : "alamofire",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/Alamofire/Alamofire",
|
||||
"state" : {
|
||||
"revision" : "f455c2975872ccd2d9c81594c658af65716e9b9a",
|
||||
"version" : "5.9.1"
|
||||
"revision" : "513364f870f6bfc468f9d2ff0a95caccc10044c5",
|
||||
"version" : "5.10.2"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -19,8 +19,7 @@ let package = Package(
|
||||
],
|
||||
dependencies: [
|
||||
// Dependencies declare other packages that this package depends on.
|
||||
// TODO: Alamofire versions 5.10.0 and above are not currently supported. If you need a newer version, please consider submitting a Pull Request with the required changes.
|
||||
.package(url: "https://github.com/Alamofire/Alamofire", exact: "5.9.1"),
|
||||
.package(url: "https://github.com/Alamofire/Alamofire", exact: "5.10.2"),
|
||||
.package(url: "https://github.com/mxcl/PromiseKit", .upToNextMajor(from: "8.1.2")),
|
||||
.package(url: "https://github.com/ReactiveX/RxSwift", .upToNextMajor(from: "6.8.0")),
|
||||
],
|
||||
|
@ -11,8 +11,7 @@ Pod::Spec.new do |s|
|
||||
s.homepage = 'https://github.com/openapitools/openapi-generator'
|
||||
s.summary = 'PetstoreClient'
|
||||
s.source_files = 'Sources/PetstoreClient/**/*.swift'
|
||||
# TODO: Alamofire versions 5.10.0 and above are not currently supported. If you need a newer version, please consider submitting a Pull Request with the required changes.
|
||||
s.dependency 'Alamofire', '5.9.1'
|
||||
s.dependency 'Alamofire', '5.10.2'
|
||||
s.dependency 'PromiseKit/CorePromise', '~> 8.1'
|
||||
s.dependency 'RxSwift', '~> 6.8'
|
||||
end
|
||||
|
@ -153,7 +153,7 @@ open class AnotherFakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/json",
|
||||
]
|
||||
|
||||
|
@ -146,7 +146,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -285,7 +285,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -424,7 +424,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -563,7 +563,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -702,7 +702,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/json",
|
||||
]
|
||||
|
||||
@ -847,10 +847,10 @@ open class FakeAPI {
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"query": (wrappedValue: query.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"query": (wrappedValue: query.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/json",
|
||||
]
|
||||
|
||||
@ -996,7 +996,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/json",
|
||||
]
|
||||
|
||||
@ -1232,21 +1232,21 @@ open class FakeAPI {
|
||||
open 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 localVariablePath = "/fake"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"integer": integer?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"int32": int32?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"int64": int64?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"number": number.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"float": float?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"double": double.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"string": string?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"pattern_without_delimiter": patternWithoutDelimiter.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"byte": byte.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"binary": binary?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"date": date?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"dateTime": dateTime?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"password": password?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"callback": callback?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
"integer": integer?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"int32": int32?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"int64": int64?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"number": number.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"float": float?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"double": double.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"string": string?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"pattern_without_delimiter": patternWithoutDelimiter.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"byte": byte.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"binary": binary?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"date": date?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"dateTime": dateTime?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"password": password?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
@ -1254,7 +1254,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
]
|
||||
|
||||
@ -1512,9 +1512,9 @@ open class FakeAPI {
|
||||
open func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder<Void> {
|
||||
let localVariablePath = "/fake"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"enum_form_string_array": enumFormStringArray?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"enum_form_string": enumFormString?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
"enum_form_string_array": enumFormStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
@ -1522,16 +1522,16 @@ open class FakeAPI {
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"enum_query_string_array": (wrappedValue: enumQueryStringArray?.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"enum_query_string": (wrappedValue: enumQueryString?.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"enum_query_integer": (wrappedValue: enumQueryInteger?.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"enum_query_double": (wrappedValue: enumQueryDouble?.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"enum_query_string_array": (wrappedValue: enumQueryStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"enum_query_string": (wrappedValue: enumQueryString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"enum_query_integer": (wrappedValue: enumQueryInteger?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"enum_query_double": (wrappedValue: enumQueryDouble?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
"enum_header_string_array": enumHeaderStringArray?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"enum_header_string": enumHeaderString?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"enum_header_string_array": enumHeaderStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"enum_header_string": enumHeaderString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
@ -1707,19 +1707,19 @@ open class FakeAPI {
|
||||
open func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder<Void> {
|
||||
let localVariablePath = "/fake"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"required_string_group": (wrappedValue: requiredStringGroup.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"required_int64_group": (wrappedValue: requiredInt64Group.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"string_group": (wrappedValue: stringGroup?.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"int64_group": (wrappedValue: int64Group?.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"required_string_group": (wrappedValue: requiredStringGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"required_int64_group": (wrappedValue: requiredInt64Group.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"string_group": (wrappedValue: stringGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"int64_group": (wrappedValue: int64Group?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
"required_boolean_group": requiredBooleanGroup.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"boolean_group": booleanGroup?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"required_boolean_group": requiredBooleanGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"boolean_group": booleanGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
@ -1863,7 +1863,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/json",
|
||||
]
|
||||
|
||||
@ -2011,9 +2011,9 @@ open class FakeAPI {
|
||||
open func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder<Void> {
|
||||
let localVariablePath = "/fake/jsonFormData"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"param": param.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"param2": param2.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
"param": param.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
@ -2021,7 +2021,7 @@ open class FakeAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
]
|
||||
|
||||
|
@ -156,7 +156,7 @@ open class FakeClassnameTags123API {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/json",
|
||||
]
|
||||
|
||||
|
@ -158,7 +158,7 @@ open class PetAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/json",
|
||||
]
|
||||
|
||||
@ -312,12 +312,12 @@ open class PetAPI {
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
"api_key": apiKey?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"api_key": apiKey?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
@ -470,14 +470,14 @@ open class PetAPI {
|
||||
open func findPetsByStatusWithRequestBuilder(status: [Status_findPetsByStatus]) -> RequestBuilder<[Pet]> {
|
||||
let localVariablePath = "/pet/findByStatus"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"status": (wrappedValue: status.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"status": (wrappedValue: status.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -629,14 +629,14 @@ open class PetAPI {
|
||||
open func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> {
|
||||
let localVariablePath = "/pet/findByTags"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"tags": (wrappedValue: tags.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"tags": (wrappedValue: tags.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -784,11 +784,11 @@ open class PetAPI {
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -936,7 +936,7 @@ open class PetAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/json",
|
||||
]
|
||||
|
||||
@ -1097,9 +1097,9 @@ open class PetAPI {
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"name": name?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"status": status?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
"name": name?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
@ -1107,7 +1107,7 @@ open class PetAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
]
|
||||
|
||||
@ -1268,9 +1268,9 @@ open class PetAPI {
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"additionalMetadata": additionalMetadata?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"file": file?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
"additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
@ -1278,7 +1278,7 @@ open class PetAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "multipart/form-data",
|
||||
]
|
||||
|
||||
@ -1439,9 +1439,9 @@ open class PetAPI {
|
||||
let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: Any?] = [
|
||||
"additionalMetadata": additionalMetadata?.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
"requiredFile": requiredFile.encodeToJSON(codableHelper: apiConfiguration.codableHelper),
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
"additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
@ -1449,7 +1449,7 @@ open class PetAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "multipart/form-data",
|
||||
]
|
||||
|
||||
|
@ -152,11 +152,11 @@ open class StoreAPI {
|
||||
let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -294,11 +294,11 @@ open class StoreAPI {
|
||||
open func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> {
|
||||
let localVariablePath = "/store/inventory"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -443,11 +443,11 @@ open class StoreAPI {
|
||||
let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -592,7 +592,7 @@ open class StoreAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
|
@ -153,7 +153,7 @@ open class UserAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -298,7 +298,7 @@ open class UserAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -443,7 +443,7 @@ open class UserAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -588,11 +588,11 @@ open class UserAPI {
|
||||
let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -736,11 +736,11 @@ open class UserAPI {
|
||||
let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -889,15 +889,15 @@ open class UserAPI {
|
||||
open func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder<String> {
|
||||
let localVariablePath = "/user/login"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"username": (wrappedValue: username.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"password": (wrappedValue: password.encodeToJSON(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"username": (wrappedValue: username.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"password": (wrappedValue: password.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -1031,11 +1031,11 @@ open class UserAPI {
|
||||
open func logoutUserWithRequestBuilder() -> RequestBuilder<Void> {
|
||||
let localVariablePath = "/user/logout"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableParameters: [String: Any]? = nil
|
||||
let localVariableParameters: [String: any Sendable]? = nil
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
@ -1191,7 +1191,7 @@ open class UserAPI {
|
||||
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: Any?] = [
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
:
|
||||
]
|
||||
|
||||
|
@ -7,8 +7,8 @@
|
||||
import Foundation
|
||||
|
||||
public struct APIHelper {
|
||||
public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? {
|
||||
let destination = source.reduce(into: [String: Any]()) { result, item in
|
||||
public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? {
|
||||
let destination = source.reduce(into: [String: any Sendable]()) { result, item in
|
||||
if let value = item.value {
|
||||
result[item.key] = value
|
||||
}
|
||||
@ -20,7 +20,7 @@ public struct APIHelper {
|
||||
return destination
|
||||
}
|
||||
|
||||
public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
|
||||
public static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] {
|
||||
return source.reduce(into: [String: String]()) { result, item in
|
||||
if let collection = item.value as? [Any?] {
|
||||
result[item.key] = collection
|
||||
@ -32,12 +32,12 @@ public struct APIHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? {
|
||||
public static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? {
|
||||
guard let source = source else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return source.reduce(into: [String: Any]()) { result, item in
|
||||
return source.reduce(into: [String: any Sendable]()) { result, item in
|
||||
switch item.value {
|
||||
case let x as Bool:
|
||||
result[item.key] = x.description
|
||||
@ -99,7 +99,7 @@ public struct APIHelper {
|
||||
/// maps all values from source to query parameters
|
||||
///
|
||||
/// collection values are always exploded
|
||||
public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
|
||||
public static func mapValuesToQueryItems(_ source: [String: (any Sendable)?]) -> [URLQueryItem]? {
|
||||
let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in
|
||||
if let collection = item.value as? [Any?] {
|
||||
collection
|
||||
|
@ -64,7 +64,7 @@ open class PetstoreClientAPIConfiguration: @unchecked Sendable {
|
||||
open class RequestBuilder<T>: @unchecked Sendable {
|
||||
public var credential: URLCredential?
|
||||
public var headers: [String: String]
|
||||
public let parameters: [String: Any]?
|
||||
public let parameters: [String: any Sendable]?
|
||||
public let method: String
|
||||
public let URLString: String
|
||||
public let requestTask: RequestTask = RequestTask()
|
||||
@ -74,7 +74,7 @@ open class RequestBuilder<T>: @unchecked Sendable {
|
||||
/// Optional block to obtain a reference to the request's progress instance when available.
|
||||
public var onProgressReady: ((Progress) -> Void)?
|
||||
|
||||
required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) {
|
||||
required public init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) {
|
||||
self.method = method
|
||||
self.URLString = URLString
|
||||
self.parameters = parameters
|
||||
|
@ -28,7 +28,7 @@ fileprivate class AlamofireRequestBuilderConfiguration: @unchecked Sendable {
|
||||
}
|
||||
|
||||
open class AlamofireRequestBuilder<T>: RequestBuilder<T>, @unchecked Sendable {
|
||||
required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) {
|
||||
required public init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: PetstoreClientAPIConfiguration = PetstoreClientAPIConfiguration.shared) {
|
||||
super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication, apiConfiguration: apiConfiguration)
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T>, @unchecked Sendable {
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
override open func execute(completion: @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) -> RequestTask {
|
||||
override open func execute(completion: @Sendable @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) -> RequestTask {
|
||||
let managerId = UUID().uuidString
|
||||
// Create a new manager for each request to customize its request header
|
||||
let manager = createAlamofireSession()
|
||||
@ -163,12 +163,12 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T>, @unchecked Sendable {
|
||||
return requestTask
|
||||
}
|
||||
|
||||
fileprivate func processRequest(request: DataRequest, managerId: String, completion: @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) {
|
||||
fileprivate func processRequest(request: DataRequest, managerId: String, completion: @Sendable @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) {
|
||||
if let credential = self.credential {
|
||||
request.authenticate(with: credential)
|
||||
}
|
||||
|
||||
let cleanupRequest = {
|
||||
let cleanupRequest = { @Sendable in
|
||||
AlamofireRequestBuilderConfiguration.shared.managerStore[managerId] = nil
|
||||
}
|
||||
|
||||
@ -257,12 +257,12 @@ open class AlamofireRequestBuilder<T>: RequestBuilder<T>, @unchecked Sendable {
|
||||
|
||||
open class AlamofireDecodableRequestBuilder<T: Decodable>: AlamofireRequestBuilder<T>, @unchecked Sendable {
|
||||
|
||||
override fileprivate func processRequest(request: DataRequest, managerId: String, completion: @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) {
|
||||
override fileprivate func processRequest(request: DataRequest, managerId: String, completion: @Sendable @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) {
|
||||
if let credential = self.credential {
|
||||
request.authenticate(with: credential)
|
||||
}
|
||||
|
||||
let cleanupRequest = {
|
||||
let cleanupRequest = { @Sendable in
|
||||
AlamofireRequestBuilderConfiguration.shared.managerStore[managerId] = nil
|
||||
}
|
||||
|
||||
@ -415,6 +415,6 @@ extension JSONDataEncoding: ParameterEncoding {
|
||||
public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest {
|
||||
let urlRequest = try urlRequest.asURLRequest()
|
||||
|
||||
return encode(urlRequest, with: parameters)
|
||||
return encode(request: urlRequest, with: parameters)
|
||||
}
|
||||
}
|
||||
|
@ -10,73 +10,49 @@ import FoundationNetworking
|
||||
#endif
|
||||
@preconcurrency import PromiseKit
|
||||
|
||||
extension Bool: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
extension Bool: QueryStringEncodable {}
|
||||
extension Float: QueryStringEncodable {}
|
||||
extension Int: QueryStringEncodable {}
|
||||
extension Int32: QueryStringEncodable {}
|
||||
extension Int64: QueryStringEncodable {}
|
||||
extension Double: QueryStringEncodable {}
|
||||
extension Decimal: QueryStringEncodable {}
|
||||
extension String: QueryStringEncodable {}
|
||||
extension URL: QueryStringEncodable {}
|
||||
extension UUID: QueryStringEncodable {}
|
||||
|
||||
extension QueryStringEncodable {
|
||||
@_disfavoredOverload
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) }
|
||||
}
|
||||
|
||||
extension Float: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
extension RawRepresentable where RawValue: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) }
|
||||
}
|
||||
|
||||
extension Int: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension Int32: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension Int64: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension Double: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension Decimal: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension String: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension URL: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension UUID: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { self }
|
||||
}
|
||||
|
||||
extension RawRepresentable where RawValue: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any { return self.rawValue }
|
||||
}
|
||||
|
||||
private func encodeIfPossible<T>(_ object: T, codableHelper: CodableHelper) -> Any {
|
||||
if let encodableObject = object as? JSONEncodable {
|
||||
return encodableObject.encodeToJSON(codableHelper: codableHelper)
|
||||
private func encodeIfPossible<T>(_ object: T, codableHelper: CodableHelper) -> String {
|
||||
if let encodableObject = object as? QueryStringEncodable {
|
||||
return encodableObject.encodeToQueryString(codableHelper: codableHelper)
|
||||
} else {
|
||||
return object
|
||||
return String(describing: object)
|
||||
}
|
||||
}
|
||||
|
||||
extension Array: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
extension Array {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> [String] {
|
||||
return self.map { encodeIfPossible($0, codableHelper: codableHelper) }
|
||||
}
|
||||
}
|
||||
|
||||
extension Set: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
return Array(self).encodeToJSON(codableHelper: codableHelper)
|
||||
extension Set {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> [String] {
|
||||
return Array(self).encodeToQueryString(codableHelper: codableHelper)
|
||||
}
|
||||
}
|
||||
|
||||
extension Dictionary: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
var dictionary = [AnyHashable: Any]()
|
||||
extension Dictionary {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> [Key: String] {
|
||||
var dictionary = [Key: String]()
|
||||
for (key, value) in self {
|
||||
dictionary[key] = encodeIfPossible(value, codableHelper: codableHelper)
|
||||
}
|
||||
@ -84,24 +60,24 @@ extension Dictionary: JSONEncodable {
|
||||
}
|
||||
}
|
||||
|
||||
extension Data: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
extension Data: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String {
|
||||
return self.base64EncodedString(options: Data.Base64EncodingOptions())
|
||||
}
|
||||
}
|
||||
|
||||
extension Date: JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
extension Date: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String {
|
||||
return codableHelper.dateFormatter.string(from: self)
|
||||
}
|
||||
}
|
||||
|
||||
extension JSONEncodable where Self: Encodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any {
|
||||
extension QueryStringEncodable where Self: Encodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String {
|
||||
guard let data = try? codableHelper.jsonEncoder.encode(self) else {
|
||||
fatalError("Could not encode to json: \(self)")
|
||||
}
|
||||
return data.encodeToJSON(codableHelper: codableHelper)
|
||||
return data.encodeToQueryString(codableHelper: codableHelper)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ import Foundation
|
||||
import FoundationNetworking
|
||||
#endif
|
||||
|
||||
public struct JSONDataEncoding {
|
||||
public struct JSONDataEncoding: Sendable {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
@ -27,8 +27,8 @@ public struct JSONDataEncoding {
|
||||
/// - throws: An `Error` if the encoding process encounters an error.
|
||||
///
|
||||
/// - returns: The encoded request.
|
||||
public func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) -> URLRequest {
|
||||
var urlRequest = urlRequest
|
||||
public func encode(request: URLRequest, with parameters: [String: any Sendable]?) -> URLRequest {
|
||||
var urlRequest = request
|
||||
|
||||
guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else {
|
||||
return urlRequest
|
||||
@ -43,10 +43,10 @@ public struct JSONDataEncoding {
|
||||
return urlRequest
|
||||
}
|
||||
|
||||
public static func encodingParameters(jsonData: Data?) -> [String: Any]? {
|
||||
var returnedParams: [String: Any]?
|
||||
public static func encodingParameters(jsonData: Data?) -> [String: any Sendable]? {
|
||||
var returnedParams: [String: any Sendable]?
|
||||
if let jsonData = jsonData, !jsonData.isEmpty {
|
||||
var params: [String: Any] = [:]
|
||||
var params: [String: any Sendable] = [:]
|
||||
params[jsonDataKey] = jsonData
|
||||
returnedParams = params
|
||||
}
|
||||
|
@ -9,8 +9,8 @@ import Foundation
|
||||
|
||||
open class JSONEncodingHelper {
|
||||
|
||||
open class func encodingParameters<T: Encodable>(forEncodableObject encodableObj: T?, codableHelper: CodableHelper) -> [String: Any]? {
|
||||
var params: [String: Any]?
|
||||
open class func encodingParameters<T: Encodable>(forEncodableObject encodableObj: T?, codableHelper: CodableHelper) -> [String: any Sendable]? {
|
||||
var params: [String: any Sendable]?
|
||||
|
||||
// Encode the Encodable object
|
||||
if let encodableObj = encodableObj {
|
||||
@ -26,8 +26,8 @@ open class JSONEncodingHelper {
|
||||
return params
|
||||
}
|
||||
|
||||
open class func encodingParameters(forEncodableObject encodableObj: Any?, codableHelper: CodableHelper) -> [String: Any]? {
|
||||
var params: [String: Any]?
|
||||
open class func encodingParameters(forEncodableObject encodableObj: Any?, codableHelper: CodableHelper) -> [String: any Sendable]? {
|
||||
var params: [String: any Sendable]?
|
||||
|
||||
if let encodableObj = encodableObj {
|
||||
do {
|
||||
|
@ -10,8 +10,8 @@ import FoundationNetworking
|
||||
#endif
|
||||
import Alamofire
|
||||
|
||||
protocol JSONEncodable {
|
||||
func encodeToJSON(codableHelper: CodableHelper) -> Any
|
||||
protocol QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String
|
||||
}
|
||||
|
||||
/// An enum where the last case value can be used as a default catch-all.
|
||||
@ -119,9 +119,9 @@ extension Response : Sendable where T : Sendable {}
|
||||
/// Type-erased ResponseSerializer
|
||||
///
|
||||
/// This is needed in order to use `ResponseSerializer` as a Type in `Configuration`. Obsolete with `any` keyword in Swift >= 5.7
|
||||
public struct AnyResponseSerializer<T>: ResponseSerializer {
|
||||
public struct AnyResponseSerializer<T: Sendable>: ResponseSerializer {
|
||||
|
||||
let _serialize: (URLRequest?, HTTPURLResponse?, Data?, Error?) throws -> T
|
||||
let _serialize: @Sendable (URLRequest?, HTTPURLResponse?, Data?, Error?) throws -> T
|
||||
|
||||
public init<V: ResponseSerializer>(_ delegatee: V) where V.SerializedObject == T {
|
||||
_serialize = delegatee.serialize
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct AdditionalPropertiesClass: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct AdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var mapString: [String: String]?
|
||||
public var mapMapString: [String: [String: String]]?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Animal: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct Animal: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ApiResponse: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct ApiResponse: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var code: Int?
|
||||
public var type: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var arrayArrayNumber: [[Double]]?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayOfNumberOnly: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct ArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var arrayNumber: [Double]?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayTest: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct ArrayTest: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var arrayOfString: [String]?
|
||||
public var arrayArrayOfInteger: [[Int64]]?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Capitalization: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct Capitalization: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var smallCamel: String?
|
||||
public var capitalCamel: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Cat: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct Cat: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Category: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct Category: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var id: Int64?
|
||||
public var name: String? = "default-name"
|
||||
|
@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
|
||||
/** Model for testing model with \"_class\" property */
|
||||
public struct ClassModel: Sendable, Codable, JSONEncodable, Hashable {
|
||||
public struct ClassModel: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
|
||||
public var _class: String?
|
||||
|
||||
|
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