Adding standard iso8601 json decoder #24
JaapWijnen
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
@JaapWijnen We have an idea of how to address this problem, but it unfortunately depends on some Swift 5.7 features to do it right. |
Beta Was this translation helpful? Give feedback.
2 replies
-
I'm going to convert this to a discussion for now, since it's not a "bug" with the library per se, and because we have plans for how to address more holistically in the future. For now as a workaround we recommend manually passing custom decoders/encoders. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Some discussion is probably needed on how to best approach this. Today I ran into the issues of one of my routes not working when using swift-url-routing in combination with Vapor's testing capabilities. After some digging I found it was due to Vapor's JSONDecoder and encoder defaulting to a .iso8601 date decoding/encoding strategy.
This means in our routers whenever we're using
Date
objects we'd have to inject custom json encoders and furthermore for first time users it's quite difficult to pinpoint where the issue originates from.Ideally we could do some kind of addition that lives in
vapor-routing
to not pollute this package too much with Vapor implementation details. But I'm not sure of what a good solution would be.Beta Was this translation helpful? Give feedback.
All reactions