schemaHash

Optional parameter that identifies the schema of the serialized CBOR representation for the objects of the annotated type.

When this parameter is specified, the annotation processor will build a data schema for CBOR serialization of the annotated type and compute a hash of that schema definition. If the computed hash does not match what is specified by this parameter, an error is generated.

In practice, this means that once this parameter is specified, any change to the object's CBOR representation (including its dependencies) will require an update of schemaHash (as well as schemaHash parameters for all the objects that depend on this one). This helps to make (or, perhaps, not to make) changes to serialization consciously, considering all potential implications of such changes.

While it is not an error for an object that has schemaHash specified to reference a type without either schemaHash or schemaId, it is not expected and a warning is generated.

It is sufficient to specify this parameter on the root of the sealed class hierarchy. The schema of a sealed class implicitly includes all subclasses.