-
Notifications
You must be signed in to change notification settings - Fork 23
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
Custom serde serializer for datetime #153
Custom serde serializer for datetime #153
Conversation
src/v2_0_1/helpers/mod.rs
Outdated
@@ -1,2 +1,5 @@ | |||
/// validators | |||
pub mod validator; | |||
|
|||
/// serializers | |||
pub mod serializer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very promising. My only input is that we should maybe call this something else? like rfc3339_serializer
or something more telling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got your point.
But my intention (understanding) was that, because its under the "helpers", this module serializer
would be probably a collection of "serializers", if there maybe later some other needed, not only for rfc3339_serializer.
Maybe the pub mod datetime
could/should be more like rfc3339_serializer
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think #[serde(with = "datetime_rfc3339")]
or something like that would be more explicit to developers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rfc3339_serializer
sounds good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, it 's also a "deserializer" when I think about it so maybe datetime_rfc3339
is better still
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #153 +/- ##
==========================================
+ Coverage 82.00% 82.67% +0.66%
==========================================
Files 51 24 -27
Lines 4467 4449 -18
==========================================
+ Hits 3663 3678 +15
+ Misses 804 771 -33 ☔ View full report in Codecov by Sentry. |
Related to #152