{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "AnnotationSchema.schema.json", "title": "AnnotationSchema", "description": "A source's schema of fields (`AnnotationSchema/get`): one per source per account, its id the source id.", "type": "object", "properties": { "id": { "$ref": "Common.schema.json#/$defs/SourceId" }, "source": { "$ref": "Common.schema.json#/$defs/Source" }, "fields": { "type": "object", "description": "The fields by name, at most 64.", "maxProperties": 64, "propertyNames": { "pattern": "^[a-z][a-zA-Z0-9]{0,63}$" }, "additionalProperties": { "$ref": "#/$defs/FieldDefinition" } }, "updated": { "description": "When the source last set it.", "$ref": "Common.schema.json#/$defs/UTCDate" } }, "required": ["id", "source", "fields", "updated"], "additionalProperties": false, "$defs": { "FieldDefinition": { "type": "object", "properties": { "type": { "enum": [ "string", "strings", "number", "boolean", "date", "localDate" ], "description": "The values' type." }, "title": { "$ref": "Common.schema.json#/$defs/LocalizedText" }, "shown": { "type": "boolean", "description": "Shown in the details panel." }, "facet": { "type": "boolean", "description": "Offered as a filter with value counts (`FileNode/facets`)." }, "searchable": { "type": "boolean", "description": "String values enter the full-text index (`body`, `text`)." }, "sortable": { "type": "boolean", "description": "Offered as a sort (`FileNode/query`'s `field` comparator)." }, "unit": { "description": "Shown after a number, 1–16 characters, or null.", "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 16 }, { "type": "null" } ] } }, "required": [ "type", "title", "shown", "facet", "searchable", "sortable", "unit" ], "additionalProperties": false, "description": "One field as the server answers it." }, "FieldDefinitionWrite": { "type": "object", "properties": { "type": { "enum": [ "string", "strings", "number", "boolean", "date", "localDate" ], "description": "The values' type." }, "title": { "$ref": "Common.schema.json#/$defs/LocalizedText" }, "shown": { "type": "boolean", "description": "Shown in the details panel.", "default": true }, "facet": { "type": "boolean", "description": "Offered as a filter with value counts (`FileNode/facets`).", "default": false }, "searchable": { "type": "boolean", "description": "String values enter the full-text index (`body`, `text`).", "default": false }, "sortable": { "type": "boolean", "description": "Offered as a sort (`FileNode/query`'s `field` comparator).", "default": false }, "unit": { "description": "Shown after a number, 1–16 characters, or null.", "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 16 }, { "type": "null" } ], "default": null } }, "required": ["type", "title"], "additionalProperties": false, "description": "One field as `AnnotationSchema/set` takes it." }, "Write": { "type": "object", "properties": { "fields": { "type": "object", "description": "The fields by name, at most 64.", "maxProperties": 64, "propertyNames": { "pattern": "^[a-z][a-zA-Z0-9]{0,63}$" }, "additionalProperties": { "$ref": "#/$defs/FieldDefinitionWrite" }, "default": {} } }, "required": [], "additionalProperties": false, "description": "`AnnotationSchema/set`'s `schema`: the calling source's whole schema, replacing the one it had (null removes it). A field whose type changed, or that is gone, has its values dropped." } } }