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