Merge 7a4715944308580f4ab43c93535415f366ba0ae1 into d6c46342693205f0dae441b45742d9c85d41cf33

This commit is contained in:
Lennard Sprong 2025-05-09 20:37:12 +08:00 committed by GitHub
commit b2aee28bfb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
413 changed files with 456 additions and 554 deletions

View File

@ -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 {

View File

@ -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}}

View File

@ -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}}

View File

@ -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 {

View File

@ -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]]?

View File

@ -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"

View File

@ -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?

View File

@ -7,7 +7,7 @@
import Foundation
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, Hashable {
public var arrayArrayNumber: [[Double]]?

View File

@ -7,7 +7,7 @@
import Foundation
public struct ArrayOfNumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
public struct ArrayOfNumberOnly: Sendable, Codable, Hashable {
public var arrayNumber: [Double]?

View File

@ -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]]?

View File

@ -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?

View File

@ -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"

View File

@ -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"

View File

@ -8,7 +8,7 @@
import Foundation
/** Model for testing model with \&quot;_class\&quot; property */
public struct ClassModel: Sendable, Codable, ParameterConvertible, Hashable {
public struct ClassModel: Sendable, Codable, Hashable {
public var _class: String?

View File

@ -7,7 +7,7 @@
import Foundation
public struct Client: Sendable, Codable, ParameterConvertible, Hashable {
public struct Client: Sendable, Codable, Hashable {
public var client: String?

View File

@ -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"

View File

@ -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 = ">="

View File

@ -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"

View File

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

View File

@ -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]?

View 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)

View File

@ -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?

View File

@ -7,7 +7,7 @@
import Foundation
public struct List: Sendable, Codable, ParameterConvertible, Hashable {
public struct List: Sendable, Codable, Hashable {
public var _123list: String?

View File

@ -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"

View File

@ -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?

View File

@ -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?

View File

@ -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)

View File

@ -7,7 +7,7 @@
import Foundation
public struct NumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
public struct NumberOnly: Sendable, Codable, Hashable {
public var justNumber: Double?

View File

@ -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"

View File

@ -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?

View File

@ -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"

View File

@ -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?

View File

@ -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?

View File

@ -7,7 +7,7 @@
import Foundation
public struct SpecialModelName: Sendable, Codable, ParameterConvertible, Hashable {
public struct SpecialModelName: Sendable, Codable, Hashable {
public var specialPropertyName: Int64?

View File

@ -7,7 +7,7 @@
import Foundation
public struct StringBooleanMap: Sendable, Codable, ParameterConvertible, Hashable {
public struct StringBooleanMap: Sendable, Codable, Hashable {
public enum CodingKeys: CodingKey, CaseIterable {

View File

@ -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?

View File

@ -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

View File

@ -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

View File

@ -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?

View File

@ -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 {

View File

@ -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]]?

View File

@ -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"

View File

@ -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?

View File

@ -7,7 +7,7 @@
import Foundation
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, Hashable {
public var arrayArrayNumber: [[Double]]?

View File

@ -7,7 +7,7 @@
import Foundation
public struct ArrayOfNumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
public struct ArrayOfNumberOnly: Sendable, Codable, Hashable {
public var arrayNumber: [Double]?

View File

@ -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]]?

View File

@ -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?

View File

@ -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"

View File

@ -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"

View File

@ -8,7 +8,7 @@
import Foundation
/** Model for testing model with \&quot;_class\&quot; property */
public struct ClassModel: Sendable, Codable, ParameterConvertible, Hashable {
public struct ClassModel: Sendable, Codable, Hashable {
public var _class: String?

View File

@ -7,7 +7,7 @@
import Foundation
public struct Client: Sendable, Codable, ParameterConvertible, Hashable {
public struct Client: Sendable, Codable, Hashable {
public var client: String?

View File

@ -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"

View File

@ -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 = ">="

View File

@ -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"

View File

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

View File

@ -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]?

View 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)

View File

@ -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?

View File

@ -7,7 +7,7 @@
import Foundation
public struct List: Sendable, Codable, ParameterConvertible, Hashable {
public struct List: Sendable, Codable, Hashable {
public var _123list: String?

View File

@ -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"

View File

@ -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?

View File

@ -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?

View File

@ -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)

View File

@ -7,7 +7,7 @@
import Foundation
public struct NumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
public struct NumberOnly: Sendable, Codable, Hashable {
public var justNumber: Double?

View File

@ -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"

View File

@ -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?

View File

@ -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"

View File

@ -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?

View File

@ -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?

View File

@ -7,7 +7,7 @@
import Foundation
public struct SpecialModelName: Sendable, Codable, ParameterConvertible, Hashable {
public struct SpecialModelName: Sendable, Codable, Hashable {
public var specialPropertyName: Int64?

View File

@ -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?

View File

@ -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

View File

@ -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

View File

@ -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?

View File

@ -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 {

View File

@ -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]]?

View File

@ -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"

View File

@ -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?

View File

@ -7,7 +7,7 @@
import Foundation
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, Hashable {
public var arrayArrayNumber: [[Double]]?

View File

@ -7,7 +7,7 @@
import Foundation
public struct ArrayOfNumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
public struct ArrayOfNumberOnly: Sendable, Codable, Hashable {
public var arrayNumber: [Double]?

View File

@ -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]]?

View File

@ -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?

View File

@ -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"

View File

@ -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"

View File

@ -8,7 +8,7 @@
import Foundation
/** Model for testing model with \&quot;_class\&quot; property */
public struct ClassModel: Sendable, Codable, ParameterConvertible, Hashable {
public struct ClassModel: Sendable, Codable, Hashable {
public var _class: String?

View File

@ -7,7 +7,7 @@
import Foundation
public struct Client: Sendable, Codable, ParameterConvertible, Hashable {
public struct Client: Sendable, Codable, Hashable {
public var client: String?

View File

@ -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"

View File

@ -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 = ">="

View File

@ -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"

View File

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

View File

@ -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]?

View 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)

View File

@ -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?

View File

@ -7,7 +7,7 @@
import Foundation
public struct List: Sendable, Codable, ParameterConvertible, Hashable {
public struct List: Sendable, Codable, Hashable {
public var _123list: String?

View File

@ -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"

View File

@ -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?

View File

@ -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?

View File

@ -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)

View File

@ -7,7 +7,7 @@
import Foundation
public struct NumberOnly: Sendable, Codable, ParameterConvertible, Hashable {
public struct NumberOnly: Sendable, Codable, Hashable {
public var justNumber: Double?

View File

@ -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