-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.x.x: chrono
types shouldn't be just strings
#293
Comments
This will all be solved after #193 is implemented. |
What does Serde serialize them as? Last I checked they are all treated as strings. We have no choice but to copy Serde because Specta only handles types not runtime behavior. Just cause we say the type is I am hoping to get rspc/Tauri Specta working with Type brands would be helpful but we don't need two tracking issues so i'm inclined to close this. |
Oh how cringe! I'll open this in serde then I guess? :D It's really crazy that we have all these great facilities for distinguishing different types of date semantics and we lose them all hoping that the users will parse out the semantics based on the contents of ISO string. FWIW, I have made the following hack:
I hope that it will be enough to transparently interoperate hither and thither, if it won't be, I'll report in this issue. Thank you for your feedback, this issue is indeed misplaced, so I'll close it, but I'll post my findings here so that people looking up for the reasons for this design will be able to find it and read about things they can do about it. |
It probally won't get anywhere sadly because Serde copies the JSON spec. If the JSON spec had Date's I think this whole thing would be much nicer but atlas it does not. |
Why?
When I enabled
chrono
feature flag, I expected something more fine-grained thanstring
as the output type.At least some type which denotes the original intent of time-related code, perhaps something wrapped in newtype even!
Observed outcome was that every chrono type I can fathom translates into
string
.What?
The text was updated successfully, but these errors were encountered: