Open DominatorVbN opened 9 months ago
Closing this, Seems like the issue arise only when the encodable object is passed to swiftapns, which uses https://github.com/swift-server-community/APNSwift/blob/915f4d0e5c4441388a7d95a072bd0b6cfdccb7f4/Sources/APNS/Coding/APNSJSONEncoder.swift#L21
Might be something to do with buffer.writeData(data)
.
The implementation of https://github.com/googleapis/google-api-swift-client/blob/a7a7b3c0ea6a55f51f306e3d29df86cb9fe1ff83/Sources/GoogleAPIRuntime/JSONAny.swift#L98
Works for the SwiftNIO based JSONEncoder, might be good idea to incorporate this.
This problem has be fixed by APNSwift, now on the main branch and not be released:
Decoded this successfully using
JSONDecoder().decode(AnyCodable.self, from: payloadData)
Causing error while
JSONEncoder().encode(_payloadEncodable)
Stacktrace: