Value types
How each supported value is written to JSON and read back. Anything else is treated as an object with @JsonbProperty members.
Values
Written as JSON values
The serializer is chosen by the runtime value, the deserializer by the declared type and the JSON node.
- String
- String; an empty string is left out.
- Boolean
- true; false is left out.
- Number (Int, Long, BigDecimal, …)
- Number.
- Enum
- Its name().
- UUID
- Its canonical text.
- Array[Byte]
- Base64.
- LocalDate
- ISO date, 2026-09-25.
- LocalDateTime · LocalTime
- ISO, truncated to minutes.
- Duration · Period
- toString, PT15M or P1D.
- Instant · OffsetDateTime · ZonedDateTime
- Not supported; serializing one throws IllegalArgumentException.
- Locale
- Its display language, such as German.
Containers
Java collections and maps
Containers are the java.util types, typed through their generic parameters. Scala collections are not mapped.
- java.util.List · Set · Collection
- Array; empty is left out.
- java.util.Map[String, V]
- Object keyed by the map's keys.
- DTO · other classes
- Object with @type.
Locale is written for people
A Locale is serialized as its display language, which is not a language tag. Use a String property if a client has to send the locale back.