Annotation Type JsonFormat
Picks the JSON shape a date or number field is written in.
- A
java.util.Dateis milliseconds since the epoch by default. WithJsonFormat.Shape.STRINGit is an ISO-8601 instant in UTC,2026-10-25T08:30:00.000Z. - A number is a JSON number by default. With
JsonFormat.Shape.STRINGit is the same digits in quotes -- what a JavaScript client needs for alongpast 2^53, which its numbers cannot hold exactly.
Reading accepts either shape whatever the annotation says, so a field can change its format without breaking the clients that still send the old one. Any other combination is refused by the build.
-
Nested Class Summary
Nested Classes -
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionThe shape the value is written in.
-
Element Details
-
value
JsonFormat.Shape valueThe shape the value is written in.
-