]
Nistor Adrian reassigned IPROTO-182:
------------------------------------
Assignee: Nistor Adrian
Enhance java.time.Instant default value support
-----------------------------------------------
Key: IPROTO-182
URL:
https://issues.redhat.com/browse/IPROTO-182
Project: Infinispan ProtoStream
Issue Type: Enhancement
Reporter: Dan Berindei
Assignee: Nistor Adrian
Priority: Minor
Because of IPROTO-114, I had to set a default value for {{java.time.Instant}} fields.
The {{defaultValue}} javadoc says {{The value is given in the form of a string that must
obey correct syntax (as defined by Protobuf spec.)}}, but the protobuf documentation
isn't very clear on what the default value for a {{Timestamp}} field should look like,
and {{java.time.Instant}} isn't exactly a {{Timestamp}} anyway.
The correct default value format is a positive number, representing milliseconds since
the UNIX epoch, but this format is not documented.
But negative values should also be supported, because {{java.time.Instant}} can represent
timestamps before the UNIX epoch.
It would be even better to support the RFC 3339 format
({{"1972-01-01T10:00:20.021Z"}}) that protobuf uses when mapping a {{Timestamp}}
to JSON.