Skip to content
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

Conversation

Wolfy7
Copy link
Contributor

@Wolfy7 Wolfy7 commented Feb 26, 2025

Related to #152

@@ -1,2 +1,5 @@
/// validators
pub mod validator;

/// serializers
pub mod serializer;
Copy link
Member

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?

Copy link
Contributor Author

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 ?

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rfc3339_serializer sounds good

Copy link
Member

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

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.67%. Comparing base (b119054) to head (025c655).
Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

@tommymalmqvist tommymalmqvist merged commit 5d8d861 into codelabsab:main Feb 27, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants