Object JsonCodec.Companion

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Json getDefaults() The Json every JSON codec natsy builds starts from, and the one to start a hand-built codec from.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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.