Skip to main content
Warning This document has not been updated for a while now. It may be out of date.
Last updated: 29 Jan 2018

govuk-content-store-examples: Working with JSON Schema keywords

There are various keywords available to use in your content schema. Some of the keywords listed below have been used in our more complex schemas.

Keyword Explanation
type The data type of a schema
required Specify object-level properties that must exist - by default all object properties are optional
enum To specify values a request parameter or model property can accept
oneOf, anyOf, allOf These allow you to validate the use of other subschemas in your schema
$ref To include a subschema within your schema. It can be either a relative or absolute URI
additionalProperties Controls whether properties that are not already specified can be accepted. By default any additional properties are allowed