Content type schema format

The following JSON shows the starting point for Amplience content type schemas that conform to draft 4 of the JSON Schema specification.

If you wish to make use of the additional keywords and string formats included in JSON Schema draft 7 then see the next section.

{
  "$schema": "http://bigcontent.io/cms/schema/v1/schema#",
  "id": "<url>",
  "title": "<title>",
  "description": "<description>",
  "allOf": [
    {
      "$ref": "http://bigcontent.io/cms/schema/v1/core#/definitions/content"
    }
  ],
  "type": "object",
  "properties": {

  }
}

The purpose of each of the keywords is as follows:

$schema This value specifies that the content type conforms to the Amplience meta schema defined at http://bigcontent.io/cms/schema/v1/schema#.

id This is the URL where the content type is hosted.

title The title of the content type.

description A description of the content type. This can be anything you like.

_meta field The allOf keyword in the JSON snippet above is used to include the core definitions from the Amplience meta schema. This includes the definition of the _meta field that is used to store information about content items as well as Amplience specific definitions such as content-link and content-reference. Every content item will contain this information.

type The type defined in the content type must be an object. Within this you'll define your properties as covered on the Property types page.

JSON Schema Draft 7 support

In order to support JSON Schema draft 7, you will need to use different values for the Amplience meta schema and core content definitions. Include the following at the start of your content type schema.

{
  "$schema": "http://bigcontent.io/cms/schema/v2/schema#",
  "$id": "<url>",
  "title": "<title>",
  "description": "<description>",
  "allOf": [
    {
      "$ref": "http://bigcontent.io/cms/schema/v2/core#/definitions/content"
    }
  ],
  "type": "object",
  "properties": {

  }
}

$schema This value specifies that the content type conforms to the Amplience meta schema defined at http://bigcontent.io/cms/schema/v2/schema#. This schema conforms to JSON Schema draft 7.

$id This is the URL where the content type is hosted. Note that in order for the schema to be valid, the keyword name must be "$id" not "id".

_meta field The allOf keyword in the JSON snippet above is used to include the core definitions from the Amplience meta schema at http://bigcontent.io/cms/schema/v2/core#/definitions/content.

results matching ""

    No results matching ""