-
Notifications
You must be signed in to change notification settings - Fork 102
Open
Labels
bugSomething isn't working rightSomething isn't working right
Description
Describe the bug
According to the JSON-B specification a java.time.ZoneId
instance needs to be serialized as follows (emphasis mine):
Implementations MUST support the deserialization of any time zone ID format specified in java.time.ZoneId into a field or property of type java.time.ZoneId. The serialization format of java.time.ZoneId is the normalized zone ID as specified in java.time.ZoneId.
The normalized part makes a difference when you have a ZoneId.of("UTC")
, for example. The zone ID is "UTC", but the normalized zone ID is "Z", as shown by this jshell session:
jshell> import java.time.*;
jshell> ZoneId.of("UTC").getId()
$2 ==> "UTC"
jshell> ZoneId.of("UTC").normalized().getId()
$3 ==> "Z"
To Reproduce
> System.out.println(jsonb.toJson(ZoneId.of("UTC")));
==> "UTC"
Expected behavior
Expected to serialize ZoneId.of("UTC")
as "Z"
and not as "UTC"
.
System information:
- OS: macOS 10.14.6
- Java Version: 8 & 11
- Yasson Version: 1.0.6
Metadata
Metadata
Assignees
Labels
bugSomething isn't working rightSomething isn't working right