Skip to content

Support for ISO8601 JSON standard dates and datetimes #282

@passuied

Description

@passuied

The current Codec standard json addition (e.g. NewCodecForStandardJSONFull()) only seems to support long datetimes and int dates respectively...

When passing a date as ISO8601 (e.g. 2024-01-02T19:55:36.654287-08:00), it throws the following error:

could not decode any json data in input \"2024-01-02T19:55:36.654287-08:00\",\"flavor\":\"chocolate\"} for key: \"created_date\""}

Here are the steps to reproduce:

  • Schema: {"type": "record", "name": "cupcake", "fields": [{"name": "flavor", "type": "string"}, {"name": "created_date", "type": ["null",{"type": "long","logicalType": "timestamp-millis"}],"default": null}]}
  • JSON: "{"created_date":"2024-01-02T19:55:36.654287-08:00","flavor":"chocolate"}"

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