forked from loafle/openapi-generator-original
[swift6] Add conditional Hashable conformance to NullEncodable (#20149)
This commit is contained in:
parent
18b01ca455
commit
c06db15750
@ -38,12 +38,14 @@ extension CaseIterableDefaultsLast {
|
|||||||
|
|
||||||
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
||||||
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
||||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum NullEncodable<Wrapped: Hashable>: Hashable {
|
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum NullEncodable<Wrapped> {
|
||||||
case encodeNothing
|
case encodeNothing
|
||||||
case encodeNull
|
case encodeNull
|
||||||
case encodeValue(Wrapped)
|
case encodeValue(Wrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension NullEncodable: Equatable where Wrapped: Equatable {}
|
||||||
|
extension NullEncodable: Hashable where Wrapped: Hashable {}
|
||||||
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
||||||
|
|
||||||
extension NullEncodable: Codable where Wrapped: Codable {
|
extension NullEncodable: Codable where Wrapped: Codable {
|
||||||
|
@ -38,12 +38,14 @@ extension CaseIterableDefaultsLast {
|
|||||||
|
|
||||||
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
||||||
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
||||||
public enum NullEncodable<Wrapped: Hashable>: Hashable {
|
public enum NullEncodable<Wrapped> {
|
||||||
case encodeNothing
|
case encodeNothing
|
||||||
case encodeNull
|
case encodeNull
|
||||||
case encodeValue(Wrapped)
|
case encodeValue(Wrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension NullEncodable: Equatable where Wrapped: Equatable {}
|
||||||
|
extension NullEncodable: Hashable where Wrapped: Hashable {}
|
||||||
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
||||||
|
|
||||||
extension NullEncodable: Codable where Wrapped: Codable {
|
extension NullEncodable: Codable where Wrapped: Codable {
|
||||||
|
@ -38,12 +38,14 @@ extension CaseIterableDefaultsLast {
|
|||||||
|
|
||||||
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
||||||
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
||||||
public enum NullEncodable<Wrapped: Hashable>: Hashable {
|
public enum NullEncodable<Wrapped> {
|
||||||
case encodeNothing
|
case encodeNothing
|
||||||
case encodeNull
|
case encodeNull
|
||||||
case encodeValue(Wrapped)
|
case encodeValue(Wrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension NullEncodable: Equatable where Wrapped: Equatable {}
|
||||||
|
extension NullEncodable: Hashable where Wrapped: Hashable {}
|
||||||
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
||||||
|
|
||||||
extension NullEncodable: Codable where Wrapped: Codable {
|
extension NullEncodable: Codable where Wrapped: Codable {
|
||||||
|
@ -37,12 +37,14 @@ extension CaseIterableDefaultsLast {
|
|||||||
|
|
||||||
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
||||||
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
||||||
public enum NullEncodable<Wrapped: Hashable>: Hashable {
|
public enum NullEncodable<Wrapped> {
|
||||||
case encodeNothing
|
case encodeNothing
|
||||||
case encodeNull
|
case encodeNull
|
||||||
case encodeValue(Wrapped)
|
case encodeValue(Wrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension NullEncodable: Equatable where Wrapped: Equatable {}
|
||||||
|
extension NullEncodable: Hashable where Wrapped: Hashable {}
|
||||||
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
||||||
|
|
||||||
extension NullEncodable: Codable where Wrapped: Codable {
|
extension NullEncodable: Codable where Wrapped: Codable {
|
||||||
|
@ -37,12 +37,14 @@ extension CaseIterableDefaultsLast {
|
|||||||
|
|
||||||
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
||||||
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
||||||
public enum NullEncodable<Wrapped: Hashable>: Hashable {
|
public enum NullEncodable<Wrapped> {
|
||||||
case encodeNothing
|
case encodeNothing
|
||||||
case encodeNull
|
case encodeNull
|
||||||
case encodeValue(Wrapped)
|
case encodeValue(Wrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension NullEncodable: Equatable where Wrapped: Equatable {}
|
||||||
|
extension NullEncodable: Hashable where Wrapped: Hashable {}
|
||||||
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
||||||
|
|
||||||
extension NullEncodable: Codable where Wrapped: Codable {
|
extension NullEncodable: Codable where Wrapped: Codable {
|
||||||
|
@ -37,12 +37,14 @@ extension CaseIterableDefaultsLast {
|
|||||||
|
|
||||||
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
||||||
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
||||||
public enum NullEncodable<Wrapped: Hashable>: Hashable {
|
public enum NullEncodable<Wrapped> {
|
||||||
case encodeNothing
|
case encodeNothing
|
||||||
case encodeNull
|
case encodeNull
|
||||||
case encodeValue(Wrapped)
|
case encodeValue(Wrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension NullEncodable: Equatable where Wrapped: Equatable {}
|
||||||
|
extension NullEncodable: Hashable where Wrapped: Hashable {}
|
||||||
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
||||||
|
|
||||||
extension NullEncodable: Codable where Wrapped: Codable {
|
extension NullEncodable: Codable where Wrapped: Codable {
|
||||||
|
@ -37,12 +37,14 @@ extension CaseIterableDefaultsLast {
|
|||||||
|
|
||||||
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
||||||
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
||||||
public enum NullEncodable<Wrapped: Hashable>: Hashable {
|
public enum NullEncodable<Wrapped> {
|
||||||
case encodeNothing
|
case encodeNothing
|
||||||
case encodeNull
|
case encodeNull
|
||||||
case encodeValue(Wrapped)
|
case encodeValue(Wrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension NullEncodable: Equatable where Wrapped: Equatable {}
|
||||||
|
extension NullEncodable: Hashable where Wrapped: Hashable {}
|
||||||
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
||||||
|
|
||||||
extension NullEncodable: Codable where Wrapped: Codable {
|
extension NullEncodable: Codable where Wrapped: Codable {
|
||||||
|
@ -37,12 +37,14 @@ extension CaseIterableDefaultsLast {
|
|||||||
|
|
||||||
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
||||||
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
||||||
public enum NullEncodable<Wrapped: Hashable>: Hashable {
|
public enum NullEncodable<Wrapped> {
|
||||||
case encodeNothing
|
case encodeNothing
|
||||||
case encodeNull
|
case encodeNull
|
||||||
case encodeValue(Wrapped)
|
case encodeValue(Wrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension NullEncodable: Equatable where Wrapped: Equatable {}
|
||||||
|
extension NullEncodable: Hashable where Wrapped: Hashable {}
|
||||||
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
||||||
|
|
||||||
extension NullEncodable: Codable where Wrapped: Codable {
|
extension NullEncodable: Codable where Wrapped: Codable {
|
||||||
|
@ -37,12 +37,14 @@ extension CaseIterableDefaultsLast {
|
|||||||
|
|
||||||
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
||||||
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
||||||
public enum NullEncodable<Wrapped: Hashable>: Hashable {
|
public enum NullEncodable<Wrapped> {
|
||||||
case encodeNothing
|
case encodeNothing
|
||||||
case encodeNull
|
case encodeNull
|
||||||
case encodeValue(Wrapped)
|
case encodeValue(Wrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension NullEncodable: Equatable where Wrapped: Equatable {}
|
||||||
|
extension NullEncodable: Hashable where Wrapped: Hashable {}
|
||||||
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
||||||
|
|
||||||
extension NullEncodable: Codable where Wrapped: Codable {
|
extension NullEncodable: Codable where Wrapped: Codable {
|
||||||
|
@ -37,12 +37,14 @@ extension CaseIterableDefaultsLast {
|
|||||||
|
|
||||||
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
||||||
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
||||||
public enum NullEncodable<Wrapped: Hashable>: Hashable {
|
public enum NullEncodable<Wrapped> {
|
||||||
case encodeNothing
|
case encodeNothing
|
||||||
case encodeNull
|
case encodeNull
|
||||||
case encodeValue(Wrapped)
|
case encodeValue(Wrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension NullEncodable: Equatable where Wrapped: Equatable {}
|
||||||
|
extension NullEncodable: Hashable where Wrapped: Hashable {}
|
||||||
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
||||||
|
|
||||||
extension NullEncodable: Codable where Wrapped: Codable {
|
extension NullEncodable: Codable where Wrapped: Codable {
|
||||||
|
@ -37,12 +37,14 @@ extension CaseIterableDefaultsLast {
|
|||||||
|
|
||||||
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
||||||
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
||||||
internal enum NullEncodable<Wrapped: Hashable>: Hashable {
|
internal enum NullEncodable<Wrapped> {
|
||||||
case encodeNothing
|
case encodeNothing
|
||||||
case encodeNull
|
case encodeNull
|
||||||
case encodeValue(Wrapped)
|
case encodeValue(Wrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension NullEncodable: Equatable where Wrapped: Equatable {}
|
||||||
|
extension NullEncodable: Hashable where Wrapped: Hashable {}
|
||||||
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
||||||
|
|
||||||
extension NullEncodable: Codable where Wrapped: Codable {
|
extension NullEncodable: Codable where Wrapped: Codable {
|
||||||
|
@ -37,12 +37,14 @@ extension CaseIterableDefaultsLast {
|
|||||||
|
|
||||||
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
||||||
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
||||||
public enum NullEncodable<Wrapped: Hashable>: Hashable {
|
public enum NullEncodable<Wrapped> {
|
||||||
case encodeNothing
|
case encodeNothing
|
||||||
case encodeNull
|
case encodeNull
|
||||||
case encodeValue(Wrapped)
|
case encodeValue(Wrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension NullEncodable: Equatable where Wrapped: Equatable {}
|
||||||
|
extension NullEncodable: Hashable where Wrapped: Hashable {}
|
||||||
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
||||||
|
|
||||||
extension NullEncodable: Codable where Wrapped: Codable {
|
extension NullEncodable: Codable where Wrapped: Codable {
|
||||||
|
@ -37,12 +37,14 @@ extension CaseIterableDefaultsLast {
|
|||||||
|
|
||||||
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
||||||
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
||||||
public enum NullEncodable<Wrapped: Hashable>: Hashable {
|
public enum NullEncodable<Wrapped> {
|
||||||
case encodeNothing
|
case encodeNothing
|
||||||
case encodeNull
|
case encodeNull
|
||||||
case encodeValue(Wrapped)
|
case encodeValue(Wrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension NullEncodable: Equatable where Wrapped: Equatable {}
|
||||||
|
extension NullEncodable: Hashable where Wrapped: Hashable {}
|
||||||
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
||||||
|
|
||||||
extension NullEncodable: Codable where Wrapped: Codable {
|
extension NullEncodable: Codable where Wrapped: Codable {
|
||||||
|
@ -37,12 +37,14 @@ extension CaseIterableDefaultsLast {
|
|||||||
|
|
||||||
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`)
|
||||||
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
/// or not encoded (`.encodeNothing`). Intended for request payloads.
|
||||||
public enum NullEncodable<Wrapped: Hashable>: Hashable {
|
public enum NullEncodable<Wrapped> {
|
||||||
case encodeNothing
|
case encodeNothing
|
||||||
case encodeNull
|
case encodeNull
|
||||||
case encodeValue(Wrapped)
|
case encodeValue(Wrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension NullEncodable: Equatable where Wrapped: Equatable {}
|
||||||
|
extension NullEncodable: Hashable where Wrapped: Hashable {}
|
||||||
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
extension NullEncodable: Sendable where Wrapped: Sendable {}
|
||||||
|
|
||||||
extension NullEncodable: Codable where Wrapped: Codable {
|
extension NullEncodable: Codable where Wrapped: Codable {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user