2. Serialization
Contents of DID 0.2
A DID definition is a JSON text (RFC 8259) encoded in UTF-8 without a byte-order mark, unless the specification's persistence settings choose another format (DISL 11.2), which encodes the same logical structure. Its top-level value MUST be an object. The file extension SHOULD be .did, unless the specification declares its own in language.fileExtension.
A definition SHOULD declare the schema it conforms to, and MUST declare the DID version it targets in the version key did, as "major.minor":
{
"$schema": "https://etalii.net/adp/did/schema/0.2/did.schema.json#/$defs/Definition",
"did": "0.2",
"language": { "id": "org.example.statemachine", "version": "1.2.0" }
}
The schema is published by the ADP website at
https://etalii.net/adp/did/schema/<version>/did.schema.json.
A writer of this version MUST write "did": "0.2". A reader of this version MUST accept "0.1" and "0.2", and reads a DID 0.1 definition as DID 0.2: every valid 0.1 definition is a valid 0.2 definition with the same meaning (section 12). A definition that names the 0.1 schema address in $schema is validated against the 0.2 schema.
A reader MUST refuse a definition with a higher major DID version than it supports and SHOULD warn for a higher minor version. The media type of a definition is application/vnd.did.definition+json, unless the specification declares another in persistence.mediaType.
Any object in a definition MAY contain properties whose names begin with x-. Readers MUST ignore extension properties they do not understand and MUST preserve them unchanged when rewriting a file (DISL 2.8).