Skip to content

Not all ISO 8601 offset formats are accepted #487

@j-be

Description

@j-be

Describe the bug

Yasson fails on offsets formatted as +hhmm and +hh, even though they are considered valid ISO 8601 zone offsets (see https://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators)

To Reproduce

JsonbBuilder.create().fromJson("\"2021-04-26T16:14:44.538+0000\"", Date.class);
JsonbBuilder.create().fromJson("\"2021-04-26T16:14:44.538+00\"", Date.class);

Expected behavior

Above works.

System information:

  • OS: Linux Mint 20
  • Java Version: AdoptOpenJDK (build 11.0.10+9)
  • Yasson Version: 2.0.2

Additional context

The above examples works fine using LocalDateTime.parse(isoDate, DateTimeFormatter.ISO_OFFSET_DATE_TIME).

I will push a small test project to reproduce the issue shortly. Will link it here as soon as it is ready.

EDIT: Minimal project to reproduce can be found https://github.com/j-be/yasson-487

Metadata

Metadata

Assignees

Labels

bugSomething isn't working right

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions