Skip to content
Anjunar/ DOCS

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, Short, Byte, Float, Double)
Number, read back as the declared type.
BigDecimal (java.math and scala.math)
Number with all its digits and scale, never with an exponent (120.00, not 1.2E+2). Read from the digits as written, also from a string such as "120.00", which JavaScript clients send to keep them exact.
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
ISO-8601, also read back.
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 in document order; empty is left out.
java.util.Map[String, V]
Object keyed by the map's keys, in source order.
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.