additionalProperties—and getting that wrong produces the error
most people meet first.
The
JSON schema type means JSON Schema: a schema document that constrains the data. Producing
unschematized JSON isn’t a registry feature—a record still carries the schema ID prefix.Configure the serializer
Provide the schema
Annotate your class so the serializer can derive a schema from it:JsonNode directly when you have no class to annotate—the serializer uses the schema
registered for the subject.
Open and closed content models
This is the concept that governs JSON Schema evolution.- Closed (
"additionalProperties": false)—the document may contain only the declared properties. Anything else fails validation. - Open (
additionalPropertiesabsent ortrue)—undeclared properties are permitted.
additionalProperties defaults to true in JSON Schema.
An open model makes adding a property awkward. Under an open schema, data written before the property
existed may already have contained a value under that name with a different type—so the registry
can’t prove that adding it is safe.
Compatibility rules per construct
Moving a property between
required and optional is the most common intentional change, and the
direction matters: making a property optional is backward compatible, making one required is not.
The default compatibility mode is BACKWARD. See
Evolution and compatibility.
Schema references
JSON Schema references another schema through$ref, with the reference name matching the $ref
value:
Normalization for JSON Schema
?normalize=true performs real normalization for Avro and Protobuf. For JSON Schema it does not
add semantic normalization—however, the schema is still reserialized before storage, so
whitespace-only differences between two submissions don’t create separate schemas.
The gap is field ordering: two JSON schemas that are semantically identical but list properties in
a different order are stored as two distinct schemas with two distinct IDs, and each registration
creates a new version. If your build serializes schemas non-deterministically, you can accumulate
versions that are semantically identical.
Serialize your schemas with sorted keys and a stable property order before registering them.
Next steps
Avro
Defaults, aliases, and schema resolution.
Protobuf
Field numbers, imports, and null handling.