Skip to content

Add title and description annotations to JSON Schema elements #190

@dhimmel

Description

@dhimmel

From https://json-schema.org/understanding-json-schema/reference/generic.html#annotations

JSON Schema includes a few keywords, titledescriptiondefaultexamples that aren't strictly used for validation, but are used to describe parts of a schema.

None of these "annotation" keywords are required, but they are encouraged for good practice, and can make your schema "self-documenting".

The title and description keywords must be strings. A "title" will preferably be short, whereas a "description" will provide a more lengthy explanation about the purpose of the data described by the schema.

Currently, there is confusion over what certain variables in CSL JSON are supposed to containing. Setting title and description would be helpful in addressing this. Also it would allow for a single authoritative source of CSL JSON field documentation.

examples might also be helpful, but probably not as pressing:

New in draft 6 The examples keyword is a place to provide an array of examples that validate against the schema. This isn't used for validation, but may help with explaining the effect and purpose of the schema to a reader. Each entry should validate against the schema in which is resides, but that isn't strictly required. There is no need to duplicate the default value in the examples array, since default will be treated as another example.

However, the test suite could extract and test the examples, so examples could also help improve test coverage.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions