mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
Merge 7a4715944308580f4ab43c93535415f366ba0ae1 into d6c46342693205f0dae441b45742d9c85d41cf33
This commit is contained in:
commit
b2aee28bfb
@ -51,8 +51,10 @@ extension UUID: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { self }
|
||||
}
|
||||
|
||||
extension RawRepresentable where RawValue: ParameterConvertible, RawValue: Sendable {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { return self.rawValue }
|
||||
extension RawRepresentable where RawValue: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable {
|
||||
rawValue.asParameter(codableHelper: codableHelper)
|
||||
}
|
||||
}
|
||||
|
||||
private func encodeIfPossible<T: Sendable>(_ object: T, codableHelper: CodableHelper) -> any Sendable {
|
||||
@ -95,15 +97,6 @@ extension Date: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable {
|
||||
return codableHelper.dateFormatter.string(from: self)
|
||||
}
|
||||
}
|
||||
|
||||
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.asParameter(codableHelper: codableHelper)
|
||||
}
|
||||
}{{/useVapor}}{{#generateModelAdditionalProperties}}
|
||||
|
||||
extension String: @retroactive CodingKey {
|
||||
|
@ -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{{#useParameterConvertible}}, ParameterConvertible{{/useParameterConvertible}}{{/useVapor}}{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}} {
|
||||
{{/objcCompatible}}{{#objcCompatible}}@objcMembers {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} class {{classname}}: NSObject, Codable{{#useParameterConvertible}}, ParameterConvertible{{/useParameterConvertible}} {
|
||||
{{^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{{/useVapor}}{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}} {
|
||||
{{/objcCompatible}}{{#objcCompatible}}@objcMembers {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} class {{classname}}: NSObject, Codable {
|
||||
{{/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{{#useParameterConvertible}}, ParameterConvertible{{/useParameterConvertible}}{{#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{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}}{{/useVapor}} {
|
||||
{{#oneOf}}
|
||||
case type{{#transformArrayType}}{{.}}{{/transformArrayType}}({{.}})
|
||||
{{/oneOf}}
|
||||
|
@ -49,8 +49,10 @@ extension UUID: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { self }
|
||||
}
|
||||
|
||||
extension RawRepresentable where RawValue: ParameterConvertible, RawValue: Sendable {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { return self.rawValue }
|
||||
extension RawRepresentable where RawValue: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable {
|
||||
rawValue.asParameter(codableHelper: codableHelper)
|
||||
}
|
||||
}
|
||||
|
||||
private func encodeIfPossible<T: Sendable>(_ object: T, codableHelper: CodableHelper) -> any Sendable {
|
||||
@ -95,15 +97,6 @@ extension Date: ParameterConvertible {
|
||||
}
|
||||
}
|
||||
|
||||
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.asParameter(codableHelper: codableHelper)
|
||||
}
|
||||
}
|
||||
|
||||
extension String: @retroactive CodingKey {
|
||||
|
||||
public var stringValue: String {
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct AdditionalPropertiesClass: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct AdditionalPropertiesClass: Sendable, Codable, Hashable {
|
||||
|
||||
public var mapString: [String: String]?
|
||||
public var mapMapString: [String: [String: String]]?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Animal: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Animal: Sendable, Codable, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ApiResponse: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct ApiResponse: Sendable, Codable, Hashable {
|
||||
|
||||
public var code: Int?
|
||||
public var type: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, Hashable {
|
||||
|
||||
public var arrayArrayNumber: [[Double]]?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayOfNumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct ArrayOfNumberOnly: Sendable, Codable, Hashable {
|
||||
|
||||
public var arrayNumber: [Double]?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayTest: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct ArrayTest: Sendable, Codable, Hashable {
|
||||
|
||||
public var arrayOfString: [String]?
|
||||
public var arrayArrayOfInteger: [[Int64]]?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Capitalization: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Capitalization: Sendable, Codable, Hashable {
|
||||
|
||||
public var smallCamel: String?
|
||||
public var capitalCamel: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Cat: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Cat: Sendable, Codable, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Category: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Category: Sendable, Codable, 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, ParameterConvertible, Hashable {
|
||||
public struct ClassModel: Sendable, Codable, Hashable {
|
||||
|
||||
public var _class: String?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Client: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Client: Sendable, Codable, Hashable {
|
||||
|
||||
public var client: String?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Dog: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Dog: Sendable, Codable, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct EnumArrays: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct EnumArrays: Sendable, Codable, Hashable {
|
||||
|
||||
public enum JustSymbol: String, Sendable, Codable, CaseIterable {
|
||||
case greaterThanOrEqualTo = ">="
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct EnumTest: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct EnumTest: Sendable, Codable, 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, ParameterConvertible, Hashable {
|
||||
public struct File: Sendable, Codable, Hashable {
|
||||
|
||||
/** Test capitalization */
|
||||
public var sourceURI: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct FileSchemaTestClass: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct FileSchemaTestClass: Sendable, Codable, Hashable {
|
||||
|
||||
public var file: File?
|
||||
public var files: [File]?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct FormatTest: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct FormatTest: Sendable, Codable, 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, ParameterConvertible, Hashable {
|
||||
public struct HasOnlyReadOnly: Sendable, Codable, Hashable {
|
||||
|
||||
public var bar: String?
|
||||
public var foo: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct List: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct List: Sendable, Codable, Hashable {
|
||||
|
||||
public var _123list: String?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct MapTest: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct MapTest: Sendable, Codable, Hashable {
|
||||
|
||||
public enum MapOfEnumString: String, Sendable, Codable, CaseIterable {
|
||||
case upper = "UPPER"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, 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, ParameterConvertible, Hashable {
|
||||
public struct Model200Response: Sendable, Codable, 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, ParameterConvertible, Hashable {
|
||||
public struct Name: Sendable, Codable, Hashable {
|
||||
|
||||
public var name: Int
|
||||
public var snakeCase: NullEncodable<Int> = .encodeValue(11033)
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct NumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct NumberOnly: Sendable, Codable, Hashable {
|
||||
|
||||
public var justNumber: Double?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Order: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Order: Sendable, Codable, Hashable {
|
||||
|
||||
public enum Status: String, Sendable, Codable, CaseIterable {
|
||||
case placed = "placed"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct OuterComposite: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct OuterComposite: Sendable, Codable, Hashable {
|
||||
|
||||
public var myNumber: Double?
|
||||
public var myString: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Pet: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Pet: Sendable, Codable, Hashable {
|
||||
|
||||
public enum Status: String, Sendable, Codable, CaseIterable {
|
||||
case available = "available"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ReadOnlyFirst: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct ReadOnlyFirst: Sendable, Codable, 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, ParameterConvertible, Hashable {
|
||||
public struct Return: Sendable, Codable, Hashable {
|
||||
|
||||
public var _return: Int?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct SpecialModelName: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct SpecialModelName: Sendable, Codable, Hashable {
|
||||
|
||||
public var specialPropertyName: Int64?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct StringBooleanMap: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct StringBooleanMap: Sendable, Codable, Hashable {
|
||||
|
||||
|
||||
public enum CodingKeys: CodingKey, CaseIterable {
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Tag: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Tag: Sendable, Codable, Hashable {
|
||||
|
||||
public var id: Int64?
|
||||
public var name: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct TypeHolderDefault: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct TypeHolderDefault: Sendable, Codable, Hashable {
|
||||
|
||||
public var stringItem: String = "what"
|
||||
public var numberItem: Double
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct TypeHolderExample: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct TypeHolderExample: Sendable, Codable, Hashable {
|
||||
|
||||
public var stringItem: String
|
||||
public var numberItem: Double
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct User: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct User: Sendable, Codable, Hashable {
|
||||
|
||||
public var id: Int64?
|
||||
public var username: String?
|
||||
|
@ -50,8 +50,10 @@ extension UUID: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { self }
|
||||
}
|
||||
|
||||
extension RawRepresentable where RawValue: ParameterConvertible, RawValue: Sendable {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { return self.rawValue }
|
||||
extension RawRepresentable where RawValue: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable {
|
||||
rawValue.asParameter(codableHelper: codableHelper)
|
||||
}
|
||||
}
|
||||
|
||||
private func encodeIfPossible<T: Sendable>(_ object: T, codableHelper: CodableHelper) -> any Sendable {
|
||||
@ -96,15 +98,6 @@ extension Date: ParameterConvertible {
|
||||
}
|
||||
}
|
||||
|
||||
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.asParameter(codableHelper: codableHelper)
|
||||
}
|
||||
}
|
||||
|
||||
extension String: @retroactive CodingKey {
|
||||
|
||||
public var stringValue: String {
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct AdditionalPropertiesClass: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct AdditionalPropertiesClass: Sendable, Codable, Hashable {
|
||||
|
||||
public var mapString: [String: String]?
|
||||
public var mapMapString: [String: [String: String]]?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Animal: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Animal: Sendable, Codable, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ApiResponse: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct ApiResponse: Sendable, Codable, Hashable {
|
||||
|
||||
public var code: Int?
|
||||
public var type: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, Hashable {
|
||||
|
||||
public var arrayArrayNumber: [[Double]]?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayOfNumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct ArrayOfNumberOnly: Sendable, Codable, Hashable {
|
||||
|
||||
public var arrayNumber: [Double]?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayTest: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct ArrayTest: Sendable, Codable, Hashable {
|
||||
|
||||
public var arrayOfString: [String]?
|
||||
public var arrayArrayOfInteger: [[Int64]]?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Capitalization: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Capitalization: Sendable, Codable, Hashable {
|
||||
|
||||
public var smallCamel: String?
|
||||
public var capitalCamel: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Cat: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Cat: Sendable, Codable, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Category: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Category: Sendable, Codable, 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, ParameterConvertible, Hashable {
|
||||
public struct ClassModel: Sendable, Codable, Hashable {
|
||||
|
||||
public var _class: String?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Client: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Client: Sendable, Codable, Hashable {
|
||||
|
||||
public var client: String?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Dog: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Dog: Sendable, Codable, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct EnumArrays: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct EnumArrays: Sendable, Codable, Hashable {
|
||||
|
||||
public enum JustSymbol: String, Sendable, Codable, CaseIterable {
|
||||
case greaterThanOrEqualTo = ">="
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct EnumTest: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct EnumTest: Sendable, Codable, 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, ParameterConvertible, Hashable {
|
||||
public struct File: Sendable, Codable, Hashable {
|
||||
|
||||
/** Test capitalization */
|
||||
public var sourceURI: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct FileSchemaTestClass: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct FileSchemaTestClass: Sendable, Codable, Hashable {
|
||||
|
||||
public var file: File?
|
||||
public var files: [File]?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct FormatTest: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct FormatTest: Sendable, Codable, 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, ParameterConvertible, Hashable {
|
||||
public struct HasOnlyReadOnly: Sendable, Codable, Hashable {
|
||||
|
||||
public var bar: String?
|
||||
public var foo: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct List: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct List: Sendable, Codable, Hashable {
|
||||
|
||||
public var _123list: String?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct MapTest: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct MapTest: Sendable, Codable, Hashable {
|
||||
|
||||
public enum MapOfEnumString: String, Sendable, Codable, CaseIterable {
|
||||
case upper = "UPPER"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, 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, ParameterConvertible, Hashable {
|
||||
public struct Model200Response: Sendable, Codable, 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, ParameterConvertible, Hashable {
|
||||
public struct Name: Sendable, Codable, Hashable {
|
||||
|
||||
public var name: Int
|
||||
public var snakeCase: NullEncodable<Int> = .encodeValue(11033)
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct NumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct NumberOnly: Sendable, Codable, Hashable {
|
||||
|
||||
public var justNumber: Double?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Order: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Order: Sendable, Codable, Hashable {
|
||||
|
||||
public enum Status: String, Sendable, Codable, CaseIterable {
|
||||
case placed = "placed"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct OuterComposite: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct OuterComposite: Sendable, Codable, Hashable {
|
||||
|
||||
public var myNumber: Double?
|
||||
public var myString: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Pet: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Pet: Sendable, Codable, Hashable {
|
||||
|
||||
public enum Status: String, Sendable, Codable, CaseIterable {
|
||||
case available = "available"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ReadOnlyFirst: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct ReadOnlyFirst: Sendable, Codable, 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, ParameterConvertible, Hashable {
|
||||
public struct Return: Sendable, Codable, Hashable {
|
||||
|
||||
public var _return: Int?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct SpecialModelName: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct SpecialModelName: Sendable, Codable, Hashable {
|
||||
|
||||
public var specialPropertyName: Int64?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Tag: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Tag: Sendable, Codable, Hashable {
|
||||
|
||||
public var id: Int64?
|
||||
public var name: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct TypeHolderDefault: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct TypeHolderDefault: Sendable, Codable, Hashable {
|
||||
|
||||
public var stringItem: String = "what"
|
||||
public var numberItem: Double
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct TypeHolderExample: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct TypeHolderExample: Sendable, Codable, Hashable {
|
||||
|
||||
public var stringItem: String
|
||||
public var numberItem: Double
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct User: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct User: Sendable, Codable, Hashable {
|
||||
|
||||
public var id: Int64?
|
||||
public var username: String?
|
||||
|
@ -49,8 +49,10 @@ extension UUID: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { self }
|
||||
}
|
||||
|
||||
extension RawRepresentable where RawValue: ParameterConvertible, RawValue: Sendable {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable { return self.rawValue }
|
||||
extension RawRepresentable where RawValue: ParameterConvertible {
|
||||
func asParameter(codableHelper: CodableHelper) -> any Sendable {
|
||||
rawValue.asParameter(codableHelper: codableHelper)
|
||||
}
|
||||
}
|
||||
|
||||
private func encodeIfPossible<T: Sendable>(_ object: T, codableHelper: CodableHelper) -> any Sendable {
|
||||
@ -95,15 +97,6 @@ extension Date: ParameterConvertible {
|
||||
}
|
||||
}
|
||||
|
||||
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.asParameter(codableHelper: codableHelper)
|
||||
}
|
||||
}
|
||||
|
||||
extension String: @retroactive CodingKey {
|
||||
|
||||
public var stringValue: String {
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct AdditionalPropertiesClass: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct AdditionalPropertiesClass: Sendable, Codable, Hashable {
|
||||
|
||||
public var mapString: [String: String]?
|
||||
public var mapMapString: [String: [String: String]]?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Animal: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Animal: Sendable, Codable, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ApiResponse: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct ApiResponse: Sendable, Codable, Hashable {
|
||||
|
||||
public var code: Int?
|
||||
public var type: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, Hashable {
|
||||
|
||||
public var arrayArrayNumber: [[Double]]?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayOfNumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct ArrayOfNumberOnly: Sendable, Codable, Hashable {
|
||||
|
||||
public var arrayNumber: [Double]?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ArrayTest: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct ArrayTest: Sendable, Codable, Hashable {
|
||||
|
||||
public var arrayOfString: [String]?
|
||||
public var arrayArrayOfInteger: [[Int64]]?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Capitalization: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Capitalization: Sendable, Codable, Hashable {
|
||||
|
||||
public var smallCamel: String?
|
||||
public var capitalCamel: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Cat: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Cat: Sendable, Codable, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Category: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Category: Sendable, Codable, 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, ParameterConvertible, Hashable {
|
||||
public struct ClassModel: Sendable, Codable, Hashable {
|
||||
|
||||
public var _class: String?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Client: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Client: Sendable, Codable, Hashable {
|
||||
|
||||
public var client: String?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Dog: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Dog: Sendable, Codable, Hashable {
|
||||
|
||||
public var className: String
|
||||
public var color: String? = "red"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct EnumArrays: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct EnumArrays: Sendable, Codable, Hashable {
|
||||
|
||||
public enum JustSymbol: String, Sendable, Codable, CaseIterable {
|
||||
case greaterThanOrEqualTo = ">="
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct EnumTest: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct EnumTest: Sendable, Codable, 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, ParameterConvertible, Hashable {
|
||||
public struct File: Sendable, Codable, Hashable {
|
||||
|
||||
/** Test capitalization */
|
||||
public var sourceURI: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct FileSchemaTestClass: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct FileSchemaTestClass: Sendable, Codable, Hashable {
|
||||
|
||||
public var file: File?
|
||||
public var files: [File]?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct FormatTest: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct FormatTest: Sendable, Codable, 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, ParameterConvertible, Hashable {
|
||||
public struct HasOnlyReadOnly: Sendable, Codable, Hashable {
|
||||
|
||||
public var bar: String?
|
||||
public var foo: String?
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct List: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct List: Sendable, Codable, Hashable {
|
||||
|
||||
public var _123list: String?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct MapTest: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct MapTest: Sendable, Codable, Hashable {
|
||||
|
||||
public enum MapOfEnumString: String, Sendable, Codable, CaseIterable {
|
||||
case upper = "UPPER"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, 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, ParameterConvertible, Hashable {
|
||||
public struct Model200Response: Sendable, Codable, 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, ParameterConvertible, Hashable {
|
||||
public struct Name: Sendable, Codable, Hashable {
|
||||
|
||||
public var name: Int
|
||||
public var snakeCase: NullEncodable<Int> = .encodeValue(11033)
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct NumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct NumberOnly: Sendable, Codable, Hashable {
|
||||
|
||||
public var justNumber: Double?
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Order: Sendable, Codable, ParameterConvertible, Hashable {
|
||||
public struct Order: Sendable, Codable, Hashable {
|
||||
|
||||
public enum Status: String, Sendable, Codable, CaseIterable {
|
||||
case placed = "placed"
|
||||
|
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