forked from loafle/openapi-generator-original
This commit is contained in:
parent
7f01a354a5
commit
304ff96577
@ -62,6 +62,8 @@ import Vapor{{/useVapor}}
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
@ -81,3 +81,18 @@ extension OpenAPIDateWithoutTime: JSONEncodable {
|
|||||||
return OpenISO8601DateFormatter.withoutTime.string(from: self.normalizedWrappedDate())
|
return OpenISO8601DateFormatter.withoutTime.string(from: self.normalizedWrappedDate())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension OpenAPIDateWithoutTime: RawRepresentable {
|
||||||
|
public typealias RawValue = String
|
||||||
|
public init?(rawValue: String) {
|
||||||
|
if let date = OpenISO8601DateFormatter.withoutTime.date(from: rawValue) {
|
||||||
|
self.init(wrappedDate: date)
|
||||||
|
} else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public var rawValue: String {
|
||||||
|
OpenISO8601DateFormatter.withoutTime.string(from: normalizedWrappedDate())
|
||||||
|
}
|
||||||
|
}
|
@ -61,6 +61,8 @@ public struct APIHelper {
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
@ -81,3 +81,18 @@ extension OpenAPIDateWithoutTime: JSONEncodable {
|
|||||||
return OpenISO8601DateFormatter.withoutTime.string(from: self.normalizedWrappedDate())
|
return OpenISO8601DateFormatter.withoutTime.string(from: self.normalizedWrappedDate())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension OpenAPIDateWithoutTime: RawRepresentable {
|
||||||
|
public typealias RawValue = String
|
||||||
|
public init?(rawValue: String) {
|
||||||
|
if let date = OpenISO8601DateFormatter.withoutTime.date(from: rawValue) {
|
||||||
|
self.init(wrappedDate: date)
|
||||||
|
} else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public var rawValue: String {
|
||||||
|
OpenISO8601DateFormatter.withoutTime.string(from: normalizedWrappedDate())
|
||||||
|
}
|
||||||
|
}
|
@ -61,6 +61,8 @@ public struct APIHelper {
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ public struct APIHelper {
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ public struct APIHelper {
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ public struct APIHelper {
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ public struct APIHelper {
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ public struct APIHelper {
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ internal struct APIHelper {
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ public struct APIHelper {
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ public struct APIHelper {
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ public struct APIHelper {
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ public struct APIHelper {
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ public struct APIHelper {
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ public struct APIHelper {
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ public struct APIHelper {
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ public struct APIHelper {
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ public struct APIHelper {
|
|||||||
return collection
|
return collection
|
||||||
.compactMap { value in convertAnyToString(value) }
|
.compactMap { value in convertAnyToString(value) }
|
||||||
.joined(separator: ",")
|
.joined(separator: ",")
|
||||||
|
} else if let value = source as? any RawRepresentable {
|
||||||
|
return "\(value.rawValue)"
|
||||||
}
|
}
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user