mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-18 21:37:06 +00:00
[swift][client] make QueryStringEncodable return any Sendable (#21142)
* [swift][client] make QueryStringEncodable return any Sendable
* [swift][client] rename QueryStringEncodable to ParameterConvertible
* [swift][client] update migration docs
* Revert "[swift][client] update migration docs"
This reverts commit 00a490536d.
* [swift][client] rename QueryStringEncodable to ParameterConvertible
This commit is contained in:
@@ -338,7 +338,7 @@ open class FakeAPI {
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"query": (wrappedValue: query.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"query": (wrappedValue: query.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
@@ -483,20 +483,20 @@ open class FakeAPI {
|
||||
let localVariablePath = "/fake"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
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),
|
||||
"integer": integer?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"int32": int32?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"int64": int64?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"number": number.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"float": float?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"double": double.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"string": string?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"pattern_without_delimiter": patternWithoutDelimiter.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"byte": byte.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"binary": binary?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"date": date?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"dateTime": dateTime?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"password": password?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"callback": callback?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
@@ -640,8 +640,8 @@ open class FakeAPI {
|
||||
let localVariablePath = "/fake"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
"enum_form_string_array": enumFormStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"enum_form_string_array": enumFormStringArray?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"enum_form_string": enumFormString?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
@@ -649,16 +649,16 @@ open class FakeAPI {
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"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),
|
||||
"enum_query_string_array": (wrappedValue: enumQueryStringArray?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"enum_query_string": (wrappedValue: enumQueryString?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"enum_query_integer": (wrappedValue: enumQueryInteger?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"enum_query_double": (wrappedValue: enumQueryDouble?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
"enum_header_string_array": enumHeaderStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"enum_header_string": enumHeaderString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"enum_header_string_array": enumHeaderStringArray?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"enum_header_string": enumHeaderString?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
@@ -725,15 +725,15 @@ open class FakeAPI {
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"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),
|
||||
"required_string_group": (wrappedValue: requiredStringGroup.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"required_int64_group": (wrappedValue: requiredInt64Group.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"string_group": (wrappedValue: stringGroup?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"int64_group": (wrappedValue: int64Group?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"required_boolean_group": requiredBooleanGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"boolean_group": booleanGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"required_boolean_group": requiredBooleanGroup.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"boolean_group": booleanGroup?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
@@ -845,8 +845,8 @@ open class FakeAPI {
|
||||
let localVariablePath = "/fake/jsonFormData"
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
"param": param.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"param": param.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"param2": param2.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
|
||||
@@ -130,7 +130,7 @@ open class PetAPI {
|
||||
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
"api_key": apiKey?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"api_key": apiKey?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
||||
@@ -199,7 +199,7 @@ open class PetAPI {
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"status": (wrappedValue: status.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"status": (wrappedValue: status.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
@@ -265,7 +265,7 @@ open class PetAPI {
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"tags": (wrappedValue: tags.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"tags": (wrappedValue: tags.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
@@ -456,8 +456,8 @@ open class PetAPI {
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
"name": name?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"name": name?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"status": status?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
@@ -529,8 +529,8 @@ open class PetAPI {
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
"additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"additionalMetadata": additionalMetadata?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"file": file?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
@@ -602,8 +602,8 @@ open class PetAPI {
|
||||
localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil)
|
||||
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
||||
let localVariableFormParams: [String: (any Sendable)?] = [
|
||||
"additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper),
|
||||
"additionalMetadata": additionalMetadata?.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
"requiredFile": requiredFile.asParameter(codableHelper: apiConfiguration.codableHelper),
|
||||
]
|
||||
|
||||
let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams)
|
||||
|
||||
@@ -354,8 +354,8 @@ open class UserAPI {
|
||||
|
||||
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
||||
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
||||
"username": (wrappedValue: username.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"password": (wrappedValue: password.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"username": (wrappedValue: username.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
"password": (wrappedValue: password.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: false),
|
||||
])
|
||||
|
||||
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
||||
|
||||
@@ -9,78 +9,73 @@ import Foundation
|
||||
import FoundationNetworking
|
||||
#endif
|
||||
|
||||
extension QueryStringEncodable {
|
||||
@_disfavoredOverload
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) }
|
||||
extension Bool: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { self }
|
||||
}
|
||||
|
||||
extension Bool: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) }
|
||||
extension Float: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { self }
|
||||
}
|
||||
|
||||
extension Float: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) }
|
||||
extension Int: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { self }
|
||||
}
|
||||
|
||||
extension Int: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) }
|
||||
extension Int32: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { self }
|
||||
}
|
||||
|
||||
extension Int32: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) }
|
||||
extension Int64: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { self }
|
||||
}
|
||||
|
||||
extension Int64: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) }
|
||||
extension Double: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { self }
|
||||
}
|
||||
|
||||
extension Double: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) }
|
||||
extension Decimal: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { self }
|
||||
}
|
||||
|
||||
extension Decimal: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) }
|
||||
extension String: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { self }
|
||||
}
|
||||
|
||||
extension String: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) }
|
||||
extension URL: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { self }
|
||||
}
|
||||
|
||||
extension URL: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) }
|
||||
extension UUID: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { self }
|
||||
}
|
||||
|
||||
extension UUID: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) }
|
||||
extension RawRepresentable where RawValue: ParameterConvertible, RawValue: Sendable {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { return self.rawValue }
|
||||
}
|
||||
|
||||
extension RawRepresentable where RawValue: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) }
|
||||
}
|
||||
|
||||
private func encodeIfPossible<T>(_ object: T, codableHelper: CodableHelper) -> String {
|
||||
if let encodableObject = object as? QueryStringEncodable {
|
||||
return encodableObject.encodeToQueryString(codableHelper: codableHelper)
|
||||
private func encodeIfPossible<T: Sendable>(_ object: T, codableHelper: CodableHelper) -> any Sendable {
|
||||
if let encodableObject = object as? ParameterConvertible {
|
||||
return encodableObject.asParameter(codableHelper: codableHelper)
|
||||
} else {
|
||||
return String(describing: object)
|
||||
return object
|
||||
}
|
||||
}
|
||||
|
||||
extension Array {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> [String] {
|
||||
extension Array where Element: Sendable {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable {
|
||||
return self.map { encodeIfPossible($0, codableHelper: codableHelper) }
|
||||
}
|
||||
}
|
||||
|
||||
extension Set {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> [String] {
|
||||
return Array(self).encodeToQueryString(codableHelper: codableHelper)
|
||||
extension Set where Element: Sendable {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable {
|
||||
return Array(self).asParameter(codableHelper: codableHelper)
|
||||
}
|
||||
}
|
||||
|
||||
extension Dictionary {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> [Key: String] {
|
||||
var dictionary = [Key: String]()
|
||||
extension Dictionary where Key: Sendable, Value: Sendable {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable {
|
||||
var dictionary = [Key: any Sendable]()
|
||||
for (key, value) in self {
|
||||
dictionary[key] = encodeIfPossible(value, codableHelper: codableHelper)
|
||||
}
|
||||
@@ -88,24 +83,24 @@ extension Dictionary {
|
||||
}
|
||||
}
|
||||
|
||||
extension Data: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String {
|
||||
extension Data: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable {
|
||||
return self.base64EncodedString(options: Data.Base64EncodingOptions())
|
||||
}
|
||||
}
|
||||
|
||||
extension Date: QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String {
|
||||
extension Date: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable {
|
||||
return codableHelper.dateFormatter.string(from: self)
|
||||
}
|
||||
}
|
||||
|
||||
extension QueryStringEncodable where Self: Encodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String {
|
||||
extension ParameterConvertible where Self: Encodable {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable {
|
||||
guard let data = try? codableHelper.jsonEncoder.encode(self) else {
|
||||
fatalError("Could not encode to json: \(self)")
|
||||
}
|
||||
return data.encodeToQueryString(codableHelper: codableHelper)
|
||||
return data.asParameter(codableHelper: codableHelper)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ import Foundation
|
||||
import FoundationNetworking
|
||||
#endif
|
||||
|
||||
protocol QueryStringEncodable {
|
||||
func encodeToQueryString(codableHelper: CodableHelper) -> String
|
||||
protocol ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable
|
||||
}
|
||||
|
||||
/// An enum where the last case value can be used as a default catch-all.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct AdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct AdditionalPropertiesClass: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var mapString: [String: String]?
|
||||
public var mapMapString: [String: [String: String]]?
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Animal: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct Animal: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ApiResponse: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct ApiResponse: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var code: Int?
|
||||
public var type: String?
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var arrayArrayNumber: [[Double]]?
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct ArrayOfNumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var arrayNumber: [Double]?
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayTest: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct ArrayTest: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var arrayOfString: [String]?
|
||||
public var arrayArrayOfInteger: [[Int64]]?
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Capitalization: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct Capitalization: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var smallCamel: String?
|
||||
public var capitalCamel: String?
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Cat: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct Cat: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Category: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct Category: Sendable, Codable, ParameterConvertible, 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, QueryStringEncodable, Hashable {
|
||||
public struct ClassModel: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var _class: String?
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Client: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct Client: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var client: String?
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Dog: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct Dog: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct EnumArrays: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct EnumArrays: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public enum JustSymbol: String, Sendable, Codable, CaseIterable {
|
||||
case greaterThanOrEqualTo = ">="
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct EnumTest: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct EnumTest: Sendable, Codable, ParameterConvertible, 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, QueryStringEncodable, Hashable {
|
||||
public struct File: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
/** Test capitalization */
|
||||
public var sourceURI: String?
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct FileSchemaTestClass: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct FileSchemaTestClass: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var file: File?
|
||||
public var files: [File]?
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct FormatTest: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct FormatTest: Sendable, Codable, ParameterConvertible, 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, QueryStringEncodable, Hashable {
|
||||
public struct HasOnlyReadOnly: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var bar: String?
|
||||
public var foo: String?
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct List: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct List: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var _123list: String?
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct MapTest: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct MapTest: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public enum MapOfEnumString: String, Sendable, Codable, CaseIterable {
|
||||
case upper = "UPPER"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, ParameterConvertible, 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, QueryStringEncodable, Hashable {
|
||||
public struct Model200Response: Sendable, Codable, ParameterConvertible, 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, QueryStringEncodable, Hashable {
|
||||
public struct Name: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var name: Int
|
||||
public var snakeCase: NullEncodable<Int> = .encodeValue(11033)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct NumberOnly: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct NumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var justNumber: Double?
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Order: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct Order: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public enum Status: String, Sendable, Codable, CaseIterable {
|
||||
case placed = "placed"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct OuterComposite: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct OuterComposite: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var myNumber: Double?
|
||||
public var myString: String?
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Pet: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct Pet: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public enum Status: String, Sendable, Codable, CaseIterable {
|
||||
case available = "available"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ReadOnlyFirst: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct ReadOnlyFirst: Sendable, Codable, ParameterConvertible, 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, QueryStringEncodable, Hashable {
|
||||
public struct Return: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var _return: Int?
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct SpecialModelName: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct SpecialModelName: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var specialPropertyName: Int64?
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct StringBooleanMap: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct StringBooleanMap: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
|
||||
public enum CodingKeys: CodingKey, CaseIterable {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Tag: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct Tag: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var id: Int64?
|
||||
public var name: String?
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct TypeHolderDefault: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct TypeHolderDefault: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var stringItem: String = "what"
|
||||
public var numberItem: Double
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct TypeHolderExample: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct TypeHolderExample: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var stringItem: String
|
||||
public var numberItem: Double
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct User: Sendable, Codable, QueryStringEncodable, Hashable {
|
||||
public struct User: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
|
||||
public var id: Int64?
|
||||
public var username: String?
|
||||
|
||||
Reference in New Issue
Block a user