Package eu.vstoyanov.natsy.codec
Object JsonCodec.Companion
-
- All Implemented Interfaces:
public class JsonCodec.Companion
-
-
Field Summary
Fields Modifier and Type Field Description private final Jsondefaultspublic final static JsonCodec.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final JsongetDefaults()The Json every JSON codec natsy builds starts from, and the one to start a hand-built codec from. -
-
Method Detail
-
getDefaults
final Json getDefaults()
The Json every JSON codec natsy builds starts from, and the one to start a hand-built codec from.
Strict grammar: an unquoted key or value, or a number where a string belongs, is a producer bug, and quietly accepting it hides the bug until something downstream reads the wrong value. Unknown keys are still ignored, so a producer can add a field without stopping every consumer that has not been redeployed yet. Defaults are not encoded, so a field left at its default costs nothing on the wire.
CodecRegistry.Builder.configureJson is what changes this for a whole klient; this is what one codec built outside a
codecs { }block can reach.
-
-
-
-