Skip to content

Reads errors on decimal durations #556

Description

@nrktkt

Currently parsing a duration doesn't support decimal numbers. This might be improved by a) rounding the input to the nearest whole number or b) dynamically changing the temporal unit based on presence of a decimal (ie. 123.45ms becomes 123450000ns).

Happy to open a PR if a or b are agreeable behaviors.

Play JSON Version 2.8.1

API Scala

Expected Behavior

Please describe the expected behavior of the issue, starting from the first action.

parsing a decimal JSON number into a Duration succeeds

Actual Behavior

parsing a decimal JSON number returns an error stating that a long is expected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions