Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down