Skip to main content

Various partials

This schema snippet includes a collection of useful definitions that you can include in your own schemas. These partials are all used in our Dynamic Content accelerators, but are generally useful.

Pre-requisites
Link copied!

To use the definitions in this partial, you must create the schema on your hub. Partials are not registered.

How to use
Link copied!

You can use one of these definitions in another schema as follows:

"link":{
"allOf": [
{ "$ref": "https://schema-examples.com/various-partials#/definitions/link" }
]
}

Various partials example
Link copied!

{
"$schema":"http://json-schema.org/draft-07/schema#",
"$id":"https://schema-examples.com/various-partials",
"title":"Accelerator partials",
"description":"Various re-usable definitions. From the Dynamic Content accelerators",
"allOf":[
{
"$ref":"http://bigcontent.io/cms/schema/v1/core#/definitions/content"
}
],
"type":"object",
"definitions":{
"roundel":{
"title":"Roundel",
"description":"Use this to enter image roundel's details",
"type":"object",
"properties":{
"roundel":{
"$ref":"http://bigcontent.io/cms/schema/v1/core#/definitions/image-link",
"title":"Roundel image"
},
"roundelRatio":{
"type":"number",
"title":"Roundel ratio",
"description":"A value between 0 and 10 e.g. 0.6 (1 by default)",
"minimum":0,
"maximum":10
},
"roundelPosition":{
"type":"string",
"enum":[
"Top Left",
"Top Right",
"Bottom Left",
"Bottom Right",
"Center"
],
"title":"Roundel position",
"description":"Roundel position is centered by default"
}
}
},
"link":{
"title":"Link",
"description":"Use this to configure links",
"type":"object",
"properties":{
"label":{
"type":"string",
"minLength":0,
"maxLength":255,
"title":"Label"
},
"value":{
"type":"string",
"minLength":0,
"maxLength":2000,
"title":"Value",
"description":"A relative URL, absolute URL or an ID"
}
}
},
"snippet":{
"title":"Snippet",
"description":"Use this to add snippets to the blog post",
"type":"object",
"properties":{
"image":{
"type":"object",
"anyOf":[
{
"$ref":"http://bigcontent.io/cms/schema/v1/core#/definitions/image-link"
}
]
},
"title":{
"type":"string",
"minLength":0,
"maxLength":255,
"title":"Title"
},
"description":{
"type":"string",
"minLength":0,
"maxLength":500,
"title":"Description"
},
"cta":{
"type":"object",
"allOf":[
{
"$ref":"#/definitions/link"
}
]
}
}
}
}
}

Using partials

Dynamic Content accelerators