Closed jochenkiene closed 4 years ago
I added this for a workaround, which solved the problem:
private struct _UnkeyedValueEncoder: UnkeyedEncodingContainer {
var count: Int {
return 0
}
mutating func encodeNil() throws {
throw DoJSON()
}
mutating func nestedContainer<NestedKey>(keyedBy keyType: NestedKey.Type) -> KeyedEncodingContainer<NestedKey> where NestedKey : CodingKey {
fatalError()
}
mutating func nestedUnkeyedContainer() -> UnkeyedEncodingContainer {
return self
}
mutating func superEncoder() -> Encoder {
return encoder
}
var codingPath: [CodingKey] {
return self.encoder.codingPath
}
let encoder: _Encoder
init(_ encoder: _Encoder) {
self.encoder = encoder
}
mutating func encode<T>(_ value: T) throws where T : Encodable {
throw DoJSON()
}
}
Vapor just crashes if I have some data fields with some Arrays.
fatalError()
doesn’t give a descriptive error.