Uploaded image for project: 'ProtoStream'
  1. ProtoStream
  2. IPROTO-182

Enhance java.time.Instant default value support

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • None
    • None
    • False
    • False
    • None
    • Undefined

      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.

            anistor Adrian Nistor (Inactive)
            dberinde@redhat.com Dan Berindei (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: