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

Java Period and Duration needs an aggregation type #2069

Closed
4 tasks done
baywet opened this issue Dec 14, 2022 · 0 comments · Fixed by #2950
Closed
4 tasks done

Java Period and Duration needs an aggregation type #2069

baywet opened this issue Dec 14, 2022 · 0 comments · Fixed by #2950
Assignees
Labels
Java type:bug A broken experience WIP
Milestone

Comments

@baywet
Copy link
Member

baywet commented Dec 14, 2022

Java has decided to use two different types for ISO 6801 durations:

  • The Duration type which parses the time portion of the spec (PT1D2H...)
  • The Period type which parses the date portion of the spec (PT1M)

This is the only language that does that as far as I'm aware and we're wrongly mapped the duration format from OpenAPI to Period which leads to parsing exceptions when we get a time portion.

Here is what needs to happen:

  • add a DurationAndPeriod composite type to the abstractions, make sure it implements temporalAmount, and comparable, as well as throws when both sub properties have a value.
  • update the parse node and serialization writer interfaces to use that type instead of Period, rename the methods adequately.
  • update the implementations to reflect the changes in interfaces.
  • update the java refiner to map to that new type instead of the Period type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java type:bug A broken experience WIP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants