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

Duration support #689

Merged
merged 16 commits into from
Aug 6, 2023
Merged

Duration support #689

merged 16 commits into from
Aug 6, 2023

Commits on Aug 3, 2023

  1. Handle kotlin.time.Duration as java.time.Duration

    Adds converter and deserializer which bridges conversions between `kotlin.time.Duration` and `java.time.Duration`.
    
    Notes:
    * later Kotlin version adds dedicated method `kotlin.time.Duration.toJavaDuration()` which can be used instead ISO parsing (in converter)
    * ...and adds dedicated extension method `java.time.Duration.toKotlinDuration()` which can be used instead ISO parsing (in deserializer)
    kkurczewski committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    cf5281c View commit details
    Browse the repository at this point in the history
  2. Add Duration tests for data class

    In order to properly deserialize data class with duration following hacks are needed:
    * class need to have explicit static factory annotated with ``@JsonCreator`, primary ctor won't cut it
    * in data class definition value-class getter has to be annotated with Duration converter
    kkurczewski committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    7a61b3f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a1ba894 View commit details
    Browse the repository at this point in the history
  4. Cleanup

    kkurczewski committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    efeb17f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    58ca164 View commit details
    Browse the repository at this point in the history
  6. Remarks

    kkurczewski committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    bc2a0b3 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    79d8e4e View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2023

  1. Add doc note about current limitations

    Kotlin Duration is value class and as Jackson has limited support of such cases it falls under few limits:
    * data classes with Duration needs to have explicit creator method
    * Duration fields has to be annotated with explicit `@JsonDeserializer` annotation
    
    See `DurationTests` for details.
    kkurczewski committed Aug 5, 2023
    Configuration menu
    Copy the full SHA
    b56e139 View commit details
    Browse the repository at this point in the history
  2. Remarks

    kkurczewski committed Aug 5, 2023
    Configuration menu
    Copy the full SHA
    9709b83 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2023

  1. Fixing converter usage

    k163377 committed Aug 6, 2023
    Configuration menu
    Copy the full SHA
    7161b2b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a0151d4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bdc58b4 View commit details
    Browse the repository at this point in the history
  4. Update feature java doc

    kkurczewski committed Aug 6, 2023
    Configuration menu
    Copy the full SHA
    4fba300 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e650766 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f2e51b4 View commit details
    Browse the repository at this point in the history
  7. Add related issue reference in docs

    Co-authored-by: wrongwrong <[email protected]>
    kkurczewski and k163377 authored Aug 6, 2023
    Configuration menu
    Copy the full SHA
    73bf682 View commit details
    Browse the repository at this point in the history