-
Notifications
You must be signed in to change notification settings - Fork 116
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
Add support for jiff #526
Add support for jiff #526
Conversation
On their README, they have:
Though considering we don't actually depend on the api, only on the type names, we should remain relatively unaffected? |
Yes, it is a fairly new create, but this is only for the basic types, and their serialization is most likely quite stable. And in the unlikely event that they break, then we just need to update. Users of jiff are aware that it is unstable, so it should be OK. |
One possibility is to use a But yes, I do expect the serialization format to be stable. Everything conforms to the Temporal ISO 8601 spec (which combines ISO 8601, RFC 3339 and RFC 9557). |
We do have multiple features for a couple of crates, at least for uuid IIRC. Maybe still we should |
The only serious breakage I see is if the datatype names is changed, and it seems quite unlikely for that to happen. So, unless we think the basic datatypes, Timestamp, Zoned, Span, civil::Date, civil::Time will change names, I think we should be fine using "jiff" as the feature. |
I confess I don't understand the focus on names here. If jiff 0.2 is published without any changes to names, it is still true that the 0.1 version of jiff::Timestamp is a distinct type from the 0.2 version of jiff::Timestamp. To me, the question is, what will you do when chrono (for example) publishes a 0.5 release? Would you add a chrono05 feature? Publish a breaking change? Wish you had added a chrono04 feature initially? |
What I mean is that we only do a simple mapping, that will annotate the type So, that is why I say that the only way we risk breakage is if the Structs change names, since that will prevent compilation. So, this is why I don't think it is worth to use "jiff01" since I think that there are not really much risk of breakage since we have a very basic support. |
Hmmm, okay. I think I probably don't have the context for this project to make a suggestion then. If Jiff types don't appear in the public API of this crate, then I don't think my concerns apply. |
Yes, the details of the jiff datatypes are not exposed or used here in any way, the only thing this patch does is to add these basic annotations for the types Timestamp, Zoned, Span, civil::Date, civil::Time. So you may change the semantics of the types, add remove methods and this will not be affected. As long as the Structs still exists and serialize to String, we are ok. |
If the type names don't change, then maybe we could cover both 0.4 and 0.5 within the same feature name?
Basically this crates has macros which go through http handler signature and parse them to generate an openapi spec.
And now if an http handler mentions the type
And this is why we add these features, so we can map external crates types to openapi types. |
Gotya okay. If the Jiff data types aren't actually appearing in the API of your crate, and this really is just type names, then I agree this is probably fine because it means Jiff isn't actually a public dependency. There is a chance that Jiff's |
Ok, that would cause this to break, so maybe we go with jiff01, jiff02 until the API is stable, I will push an update Btw, I'm all for the civil to plain change, for me as a non-native english speaker civil feels a bit strange, while plain is a lot more natural. |
Alright let's go with jiff01 for now, thank you both! |
I have added basic support for the new jiff datetime library.