schema
stringclasses
471 values
key
stringlengths
0
203
description
stringlengths
0
4.37k
object
stringlengths
2
322k
block.json
attribute
Use an attribute source to extract the value from an attribute in the markup. The attribute is specified by the attribute field, which must be supplied. Example: Extract the src attribute from an image found in the block’s markup.
{"type": "string"}
block.json
multiline
Use the multiline property to extract the inner HTML of matching tag names for the use in RichText with the multiline prop.
{"type": "string"}
block.json
query
Use query to extract an array of values from markup. Entries of the array are determined by the selector argument, where each matched element within the block will have an entry structured corresponding to the second argument, an object of attribute sources.
{"type": "object"}
block.json
meta
Although attributes may be obtained from a post’s meta, meta attribute sources are considered deprecated; EntityProvider and related hook APIs should be used instead, as shown in the Create Meta Block how-to here: https://developer.wordpress.org/block-editor/how-to-guides/metabox/#step-2-add-meta-block
{"type": "string"}
block.json
default
A block attribute can contain a default value, which will be used if the type and source do not match anything within the block content. The value is provided by the default field, and the value should match the expected format of the attribute.
{}
block.json
providesContext
Context provided for available access by descendants of blocks of this type, in the form of an object which maps a context name to one of the block’s own attribute. See the block context documentation at https://developer.wordpress.org/block-editor/reference-guides/block-api/block-context/ for more details.
{"type": "object", "patternProperties": {"[a-zA-Z]": {"type": "string"}}}
block.json
usesContext
Array of the names of context values to inherit from an ancestor provider. See the block context documentation at https://developer.wordpress.org/block-editor/reference-guides/block-api/block-context/ for more details.
{"type": "array", "items": {"type": "string"}}
block.json
supports
It contains as set of options to control features used in the editor. See the supports documentation at https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/ for more details.
{"type": "object", "properties": {"anchor": {"type": "boolean", "default": false}, "align": {"default": false, "oneOf": [{"type": "boolean"}, {"type": "array", "items": {"type": "string", "enum": ["wide", "full", "left", "center", "right"]}}]}, "alignWide": {"type": "boolean", "default": true}, "ariaLabel": {"type": "boolean", "default": false}, "behaviors": {"type": "object", "additionalProperties": false, "properties": {"lightbox": {"type": "boolean", "default": false}}}, "className": {"type": "boolean", "default": true}, "color": {"type": "object", "properties": {"background": {"type": "boolean", "default": true}, "gradients": {"type": "boolean", "default": false}, "link": {"type": "boolean", "default": false}, "text": {"type": "boolean", "default": true}, "enableContrastChecker": {"type": "boolean", "default": true}}}, "customClassName": {"type": "boolean", "default": true}, "defaultStylePicker": {"type": "boolean", "default": true}, "dimensions": {"type": "object", "properties": {"minHeight": {"type": "boolean", "default": false}}}, "filter": {"type": "object", "properties": {"duotone": {"type": "boolean", "default": false}}}, "html": {"type": "boolean", "default": true}, "inserter": {"type": "boolean", "default": true}, "layout": {"default": false, "oneOf": [{"type": "boolean"}, {"type": "object", "properties": {"default": {"type": "object", "properties": {"type": {"type": "string", "enum": ["constrained", "grid", "flex"]}, "contentSize": {"type": "string"}, "wideSize": {"type": "string"}, "justifyContent": {"type": "string", "enum": ["right", "center", "space-between", "left", "stretch"]}, "orientation": {"type": "string", "enum": ["horizontal", "vertical"]}, "flexWrap": {"type": "string", "enum": ["wrap", "nowrap"]}, "verticalAlignment": {"type": "string", "enum": ["top", "center", "bottom", "space-between", "stretch"]}, "minimumColumnWidth": {"type": "string"}, "columnCount": {"type": "number"}}}, "allowSwitching": {"type": "boolean", "default": false}, "allowEditing": {"type": "boolean", "default": true}, "allowInheriting": {"type": "boolean", "default": true}, "allowSizingOnChildren": {"type": "boolean", "default": false}, "allowVerticalAlignment": {"type": "boolean", "default": true}, "allowJustification": {"type": "boolean", "default": true}, "allowOrientation": {"type": "boolean", "default": true}}}]}, "multiple": {"type": "boolean", "default": true}, "reusable": {"type": "boolean", "default": true}, "lock": {"type": "boolean", "default": true}, "position": {"type": "object", "properties": {"sticky": {"type": "boolean", "default": false}}}, "spacing": {"type": "object", "properties": {"margin": {"oneOf": [{"type": "boolean"}, {"type": "array", "items": {"type": "string", "enum": ["top", "right", "left", "bottom"]}}, {"type": "array", "items": {"type": "string", "enum": ["vertical", "horizontal"]}}]}, "padding": {"oneOf": [{"type": "boolean"}, {"type": "array", "items": {"type": "string", "enum": ["top", "right", "left", "bottom"]}}, {"type": "array", "items": {"type": "string", "enum": ["vertical", "horizontal"]}}]}}}, "typography": {"type": "object", "properties": {"fontSize": {"type": "boolean", "default": false}, "lineHeight": {"type": "boolean", "default": false}}}}, "additionalProperties": true}
block.json
anchor
Anchors let you link directly to a specific block on a page. This property adds a field to define an id for the block and a button to copy the direct link.
{"type": "boolean", "default": false}
block.json
align
This property adds block controls which allow to change block’s alignment.
{"default": false, "oneOf": [{"type": "boolean"}, {"type": "array", "items": {"type": "string", "enum": ["wide", "full", "left", "center", "right"]}}]}
block.json
alignWide
This property allows to enable wide alignment for your theme. To disable this behavior for a single block, set this flag to false.
{"type": "boolean", "default": true}
block.json
ariaLabel
ARIA-labels let you define an accessible label for elements. This property allows enabling the definition of an aria-label for the block, without exposing a UI field.
{"type": "boolean", "default": false}
block.json
behaviors
Behaviors are a way to add additional functionality to a block. They are defined as an object with a name and a set of properties. Curently, only one behavior is supported: lightbox.
{"type": "object", "additionalProperties": false, "properties": {"lightbox": {"type": "boolean", "default": false}}}
block.json
lightbox
This property adds a 'lightbox' behavior to the block. It allows to open the block's content in a lightbox when clicking on it.
{"type": "boolean", "default": false}
block.json
className
By default, the class .wp-block-your-block-name is added to the root element of your saved markup. This helps having a consistent mechanism for styling blocks that themes and plugins can rely on. If, for whatever reason, a class is not desired on the markup, this functionality can be disabled.
{"type": "boolean", "default": true}
block.json
color
This value signals that a block supports some of the properties related to color. When it does, the block editor will show UI controls for the user to set their values. Note that the background and text keys have a default value of true, so if the color property is present they’ll also be considered enabled
{"type": "object", "properties": {"background": {"type": "boolean", "default": true}, "gradients": {"type": "boolean", "default": false}, "link": {"type": "boolean", "default": false}, "text": {"type": "boolean", "default": true}, "enableContrastChecker": {"type": "boolean", "default": true}}}
block.json
background
This property adds UI controls which allow the user to apply a solid background color to a block. When color support is declared, this property is enabled by default (along with text), so simply setting color will enable background color. To disable background support while keeping other color supports enabled, set to false. When the block declares support for color.background, its attributes definition is extended to include two new attributes: backgroundColor and style
{"type": "boolean", "default": true}
block.json
gradients
This property adds UI controls which allow the user to apply a gradient background to a block. Gradient presets are sourced from editor-gradient-presets theme support. When the block declares support for color.gradient, its attributes definition is extended to include two new attributes: gradient and style
{"type": "boolean", "default": false}
block.json
link
This property adds block controls which allow the user to set link color in a block, link color is disabled by default. Link color presets are sourced from the editor-color-palette theme support. When the block declares support for color.link, its attributes definition is extended to include the style attribute
{"type": "boolean", "default": false}
block.json
text
This property adds block controls which allow the user to set text color in a block. When color support is declared, this property is enabled by default (along with background), so simply setting color will enable text color. Text color presets are sourced from the editor-color-palette theme support. When the block declares support for color.text, its attributes definition is extended to include two new attributes: textColor and style
{"type": "boolean", "default": true}
block.json
enableContrastChecker
Determines whether the contrast checker widget displays in the block editor UI. The contrast checker appears only if the block declares support for color. It tests the readability of color combinations and warns if there is a potential issue. The property is enabled by default. Set to `false` to explicitly disable.
{"type": "boolean", "default": true}
block.json
customClassName
This property adds a field to define a custom className for the block’s wrapper.
{"type": "boolean", "default": true}
block.json
defaultStylePicker
When the style picker is shown, a dropdown is displayed so the user can select a default style for this block type. If you prefer not to show the dropdown, set this property to false.
{"type": "boolean", "default": true}
block.json
dimensions
This value signals that a block supports some of the CSS style properties related to dimensions. When it does, the block editor will show UI controls for the user to set their values if the theme declares support. When the block declares support for a specific dimensions property, its attributes definition is extended to include the style attribute.
{"type": "object", "properties": {"minHeight": {"type": "boolean", "default": false}}}
block.json
minHeight
Allow blocks to define a minimum height value.
{"type": "boolean", "default": false}
block.json
filter
This value signals that a block supports some of the properties related to filters. When it does, the block editor will show UI controls for the user to set their values if the theme declares support. When the block declares support for a specific filter property, its attributes definition is extended to include the style attribute.
{"type": "object", "properties": {"duotone": {"type": "boolean", "default": false}}}
block.json
duotone
Allow blocks to define a duotone filter.
{"type": "boolean", "default": false}
block.json
html
By default, a block’s markup can be edited individually. To disable this behavior, set html to false.
{"type": "boolean", "default": true}
block.json
inserter
By default, all blocks will appear in the inserter, block transforms menu, Style Book, etc. To hide a block from all parts of the user interface so that it can only be inserted programmatically, set inserter to false.
{"type": "boolean", "default": true}
block.json
layout
This value only applies to blocks that are containers for inner blocks. If set to `true` the layout type will be `flow`. For other layout types it's necessary to set the `type` explicitly inside the `default` object.
{"default": false, "oneOf": [{"type": "boolean"}, {"type": "object", "properties": {"default": {"type": "object", "properties": {"type": {"type": "string", "enum": ["constrained", "grid", "flex"]}, "contentSize": {"type": "string"}, "wideSize": {"type": "string"}, "justifyContent": {"type": "string", "enum": ["right", "center", "space-between", "left", "stretch"]}, "orientation": {"type": "string", "enum": ["horizontal", "vertical"]}, "flexWrap": {"type": "string", "enum": ["wrap", "nowrap"]}, "verticalAlignment": {"type": "string", "enum": ["top", "center", "bottom", "space-between", "stretch"]}, "minimumColumnWidth": {"type": "string"}, "columnCount": {"type": "number"}}}, "allowSwitching": {"type": "boolean", "default": false}, "allowEditing": {"type": "boolean", "default": true}, "allowInheriting": {"type": "boolean", "default": true}, "allowSizingOnChildren": {"type": "boolean", "default": false}, "allowVerticalAlignment": {"type": "boolean", "default": true}, "allowJustification": {"type": "boolean", "default": true}, "allowOrientation": {"type": "boolean", "default": true}}}]}
block.json
default
Allows setting the `type` property to define what layout type is default for the block, and also default values for any properties inherent to that layout type, e.g., for a `flex` layout, a default value can be set for `flexWrap`.
{"type": "object", "properties": {"type": {"type": "string", "enum": ["constrained", "grid", "flex"]}, "contentSize": {"type": "string"}, "wideSize": {"type": "string"}, "justifyContent": {"type": "string", "enum": ["right", "center", "space-between", "left", "stretch"]}, "orientation": {"type": "string", "enum": ["horizontal", "vertical"]}, "flexWrap": {"type": "string", "enum": ["wrap", "nowrap"]}, "verticalAlignment": {"type": "string", "enum": ["top", "center", "bottom", "space-between", "stretch"]}, "minimumColumnWidth": {"type": "string"}, "columnCount": {"type": "number"}}}
block.json
type
The layout type.
{"type": "string", "enum": ["constrained", "grid", "flex"]}
block.json
contentSize
The content size used on all children.
{"type": "string"}
block.json
wideSize
The wide size used on alignwide children.
{"type": "string"}
block.json
justifyContent
Content justification value.
{"type": "string", "enum": ["right", "center", "space-between", "left", "stretch"]}
block.json
orientation
The orientation of the layout.
{"type": "string", "enum": ["horizontal", "vertical"]}
block.json
flexWrap
The flex wrap value.
{"type": "string", "enum": ["wrap", "nowrap"]}
block.json
verticalAlignment
The vertical alignment value.
{"type": "string", "enum": ["top", "center", "bottom", "space-between", "stretch"]}
block.json
minimumColumnWidth
The minimum column width value.
{"type": "string"}
block.json
columnCount
The column count value.
{"type": "number"}
block.json
allowSwitching
Exposes a switcher control that allows toggling between all existing layout types.
{"type": "boolean", "default": false}
block.json
allowEditing
Determines display of layout controls in the block sidebar. If set to false, layout controls will be hidden.
{"type": "boolean", "default": true}
block.json
allowInheriting
For the `flow` layout type only, determines display of the `Inner blocks use content width` toggle.
{"type": "boolean", "default": true}
block.json
allowSizingOnChildren
For the `flex` layout type only, determines display of sizing controls (Fit/Fill/Fixed) on all child blocks of the flex block.
{"type": "boolean", "default": false}
block.json
allowVerticalAlignment
For the `flex` layout type only, determines display of vertical alignment controls in the block toolbar.
{"type": "boolean", "default": true}
block.json
allowJustification
For the `flex` layout type, determines display of justification controls in the block toolbar and block sidebar. For the `constrained` layout type, determines display of justification control in the block sidebar.
{"type": "boolean", "default": true}
block.json
allowOrientation
For the `flex` layout type only, determines display of the orientation control in the block toolbar.
{"type": "boolean", "default": true}
block.json
multiple
A non-multiple block can be inserted into each post, one time only. For example, the built-in ‘More’ block cannot be inserted again if it already exists in the post being edited. A non-multiple block’s icon is automatically dimmed (unclickable) to prevent multiple instances.
{"type": "boolean", "default": true}
block.json
reusable
A block may want to disable the ability of being converted into a reusable block. By default all blocks can be converted to a reusable block. If supports reusable is set to false, the option to convert the block into a reusable block will not appear.
{"type": "boolean", "default": true}
block.json
lock
A block may want to disable the ability to toggle the lock state. It can be locked/unlocked by a user from the block 'Options' dropdown by default. To disable this behavior, set lock to false.
{"type": "boolean", "default": true}
block.json
position
This value signals that a block supports some of the CSS style properties related to position. When it does, the block editor will show UI controls for the user to set their values if the theme declares support. When the block declares support for a specific position property, its attributes definition is extended to include the style attribute.
{"type": "object", "properties": {"sticky": {"type": "boolean", "default": false}}}
block.json
sticky
Allow blocks to stick to their immediate parent when scrolling the page.
{"type": "boolean", "default": false}
block.json
spacing
This value signals that a block supports some of the CSS style properties related to spacing. When it does, the block editor will show UI controls for the user to set their values if the theme declares support. When the block declares support for a specific spacing property, its attributes definition is extended to include the style attribute.
{"type": "object", "properties": {"margin": {"oneOf": [{"type": "boolean"}, {"type": "array", "items": {"type": "string", "enum": ["top", "right", "left", "bottom"]}}, {"type": "array", "items": {"type": "string", "enum": ["vertical", "horizontal"]}}]}, "padding": {"oneOf": [{"type": "boolean"}, {"type": "array", "items": {"type": "string", "enum": ["top", "right", "left", "bottom"]}}, {"type": "array", "items": {"type": "string", "enum": ["vertical", "horizontal"]}}]}}}
block.json
typography
This value signals that a block supports some of the CSS style properties related to typography. When it does, the block editor will show UI controls for the user to set their values if the theme declares support. When the block declares support for a specific typography property, its attributes definition is extended to include the style attribute.
{"type": "object", "properties": {"fontSize": {"type": "boolean", "default": false}, "lineHeight": {"type": "boolean", "default": false}}}
block.json
fontSize
This value signals that a block supports the font-size CSS style property. When it does, the block editor will show an UI control for the user to set its value. The values shown in this control are the ones declared by the theme via the editor-font-sizes theme support, or the default ones if none is provided. When the block declares support for fontSize, its attributes definition is extended to include two new attributes: fontSize and style
{"type": "boolean", "default": false}
block.json
lineHeight
This value signals that a block supports the line-height CSS style property. When it does, the block editor will show an UI control for the user to set its value if the theme declares support. When the block declares support for lineHeight, its attributes definition is extended to include a new attribute style of object type with no default assigned. It stores the custom value set by the user. The block can apply a default style by specifying its own style attribute with a default
{"type": "boolean", "default": false}
block.json
selectors
Provides custom CSS selectors and mappings for the block. Selectors may be set for the block itself or per-feature e.g. typography. Custom selectors per feature or sub-feature, allow different block styles to be applied to different elements within the block.
{"type": "object", "properties": {"root": {"type": "string"}, "border": {"oneOf": [{"type": "string"}, {"type": "object", "properties": {"root": {"type": "string"}, "color": {"type": "string"}, "radius": {"type": "string"}, "style": {"type": "string"}, "width": {"type": "string"}}}]}, "color": {"oneOf": [{"type": "string"}, {"type": "object", "properties": {"root": {"type": "string"}, "text": {"type": "string"}, "background": {"type": "string"}}}]}, "dimensions": {"oneOf": [{"type": "string"}, {"type": "object", "properties": {"root": {"type": "string"}, "minHeight": {"type": "string"}}}]}, "spacing": {"oneOf": [{"type": "string"}, {"type": "object", "properties": {"root": {"type": "string"}, "blockGap": {"type": "string"}, "padding": {"type": "string"}, "margin": {"type": "string"}}}]}, "typography": {"oneOf": [{"type": "string"}, {"type": "object", "properties": {"root": {"type": "string"}, "fontFamily": {"type": "string"}, "fontSize": {"type": "string"}, "fontStyle": {"type": "string"}, "fontWeight": {"type": "string"}, "lineHeight": {"type": "string"}, "letterSpacing": {"type": "string"}, "textDecoration": {"type": "string"}, "textTransform": {"type": "string"}}}]}}}
block.json
root
The primary CSS class to apply to the block. This replaces the `.wp-block-name` class if set.
{"type": "string"}
block.json
border
Custom CSS selector used to generate rules for the block's theme.json border styles.
{"oneOf": [{"type": "string"}, {"type": "object", "properties": {"root": {"type": "string"}, "color": {"type": "string"}, "radius": {"type": "string"}, "style": {"type": "string"}, "width": {"type": "string"}}}]}
block.json
color
Custom CSS selector used to generate rules for the block's theme.json color styles.
{"oneOf": [{"type": "string"}, {"type": "object", "properties": {"root": {"type": "string"}, "text": {"type": "string"}, "background": {"type": "string"}}}]}
block.json
dimensions
Custom CSS selector used to generate rules for the block's theme.json dimensions styles.
{"oneOf": [{"type": "string"}, {"type": "object", "properties": {"root": {"type": "string"}, "minHeight": {"type": "string"}}}]}
block.json
spacing
Custom CSS selector used to generate rules for the block's theme.json spacing styles.
{"oneOf": [{"type": "string"}, {"type": "object", "properties": {"root": {"type": "string"}, "blockGap": {"type": "string"}, "padding": {"type": "string"}, "margin": {"type": "string"}}}]}
block.json
typography
Custom CSS selector used to generate rules for the block's theme.json typography styles.
{"oneOf": [{"type": "string"}, {"type": "object", "properties": {"root": {"type": "string"}, "fontFamily": {"type": "string"}, "fontSize": {"type": "string"}, "fontStyle": {"type": "string"}, "fontWeight": {"type": "string"}, "lineHeight": {"type": "string"}, "letterSpacing": {"type": "string"}, "textDecoration": {"type": "string"}, "textTransform": {"type": "string"}}}]}
block.json
styles
Block styles can be used to provide alternative styles to block. It works by adding a class name to the block’s wrapper. Using CSS, a theme developer can target the class name for the block style if it is selected. Plugins and Themes can also register custom block style for existing blocks. https://developer.wordpress.org/block-editor/reference-guides/block-api/block-styles
{"type": "array", "items": {"type": "object", "properties": {"name": {"type": "string"}, "label": {"type": "string"}, "isDefault": {"type": "boolean", "default": false}}, "required": ["name", "label"], "additionalProperties": false}}
block.json
example
It provides structured example data for the block. This data is used to construct a preview for the block to be shown in the Inspector Help Panel when the user mouses over the block. See the example documentation at https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/#example-optional for more details.
{"type": "object", "properties": {"viewportWidth": {"type": "number", "default": 1200}, "attributes": {"type": "object"}, "innerBlocks": {"type": "array"}}}
block.json
viewportWidth
The viewportWidth controls the width of the iFrame container in which the block preview will get rendered
{"type": "number", "default": 1200}
block.json
attributes
Set the attributes for the block example
{"type": "object"}
block.json
innerBlocks
Set the inner blocks that should be used within the block example. The blocks should be defined as a nested array like this: [ [ 'core/heading', { content: 'This is an Example' }, [] ] ] Where each block itself is an array that contains the block name, the block attributes, and the blocks inner blocks.
{"type": "array"}
block.json
editorScript
Block type editor script definition. It will only be enqueued in the context of the editor.
{"oneOf": [{"type": "string"}, {"type": "array", "items": {"type": "string"}}]}
block.json
script
Block type frontend and editor script definition. It will be enqueued both in the editor and when viewing the content on the front of the site.
{"oneOf": [{"type": "string"}, {"type": "array", "items": {"type": "string"}}]}
block.json
viewScript
Block type frontend script definition. It will be enqueued only when viewing the content on the front of the site.
{"oneOf": [{"type": "string"}, {"type": "array", "items": {"type": "string"}}]}
block.json
editorStyle
Block type editor style definition. It will only be enqueued in the context of the editor.
{"oneOf": [{"type": "string"}, {"type": "array", "items": {"type": "string"}}]}
block.json
style
Block type frontend style definition. It will be enqueued both in the editor and when viewing the content on the front of the site.
{"oneOf": [{"type": "string"}, {"type": "array", "items": {"type": "string"}}]}
block.json
variations
Block Variations is the API that allows a block to have similar versions of it, but all these versions share some common functionality.
{"type": "array", "items": {"type": "object", "required": ["name", "title"], "additionalProperties": false, "properties": {"name": {"type": "string"}, "category": {"anyOf": [{"type": "string"}, {"enum": ["text", "media", "design", "widgets", "theme", "embed"]}]}, "icon": {"type": "string"}, "isDefault": {"type": "boolean", "default": false}, "attributes": {"type": "object"}, "innerBlocks": {"type": "array", "items": {"type": "array"}}, "example": {"type": "object"}, "scope": {"type": "array", "items": {"enum": ["inserter", "block", "transform"]}, "default": ["inserter", "block"]}, "keywords": {"type": "array", "items": {"type": "string"}}, "isActive": {"type": "array", "items": {"type": "string"}}}}}
block.json
name
The unique and machine-readable name.
{"type": "string"}
block.json
title
A human-readable variation title.
{"type": "string"}
block.json
description
A detailed variation description.
{"type": "string"}
block.json
category
A category classification, used in search interfaces to arrange block types by category.
{"anyOf": [{"type": "string"}, {"enum": ["text", "media", "design", "widgets", "theme", "embed"]}]}
block.json
icon
An icon helping to visualize the variation. It can have the same shape as the block type.
{"type": "string"}
block.json
isDefault
Indicates whether the current variation is the default one.
{"type": "boolean", "default": false}
block.json
attributes
Values that override block attributes.
{"type": "object"}
block.json
innerBlocks
Initial configuration of nested blocks.
{"type": "array", "items": {"type": "array"}}
block.json
example
Example provides structured data for the block preview. You can set to undefined to disable the preview shown for the block type.
{"type": "object"}
block.json
scope
The list of scopes where the variation is applicable.
{"type": "array", "items": {"enum": ["inserter", "block", "transform"]}, "default": ["inserter", "block"]}
block.json
keywords
An array of terms (which can be translated) that help users discover the variation while searching.
{"type": "array", "items": {"type": "string"}}
block.json
isActive
The list of attributes that should be compared. Each attributes will be matched and the variation will be active if all of them are matching.
{"type": "array", "items": {"type": "string"}}
block.json
render
Template file loaded on the server when rendering a block.
{"type": "string"}
1.0.schema.json
Error-Pages config file schema.
{"$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": {"templates": {"type": "array", "items": {"type": "object", "properties": {"path": {"type": "string", "examples": ["./templates/ghost.html", "/opt/tpl/ghost.htm"]}, "name": {"type": "string", "examples": ["ghost"]}, "content": {"type": "string", "examples": ["<html><body>{{ code }}: {{ message }}</body></html>"]}}, "additionalProperties": false}}, "formats": {"type": "object", "properties": {"json": {"type": "object", "properties": {"content": {"type": "string", "examples": ["{\"error\": true, \"code\": {{ code | json }}, \"message\": {{ message | json }}}"]}}, "additionalProperties": false}, "xml": {"type": "object", "properties": {"content": {"type": "string", "examples": ["<?xml version=\"1.0\" encoding=\"utf-8\"?><error><code>{{ code }}</code><message>{{ message }}</message></error>"]}}, "additionalProperties": false}}, "additionalProperties": false}, "pages": {"type": "object", "patternProperties": {"^[a-zA-Z0-9_-]+$": {"type": "object", "properties": {"message": {"type": "string", "examples": ["Bad Request"]}}, "additionalProperties": false}}, "additionalProperties": false}}, "additionalProperties": false, "required": ["templates"]}
1.0.schema.json
templates
Templates list
{"type": "array", "items": {"type": "object", "properties": {"path": {"type": "string", "examples": ["./templates/ghost.html", "/opt/tpl/ghost.htm"]}, "name": {"type": "string", "examples": ["ghost"]}, "content": {"type": "string", "examples": ["<html><body>{{ code }}: {{ message }}</body></html>"]}}, "additionalProperties": false}}
1.0.schema.json
items
Template properties
{"type": "object", "properties": {"path": {"type": "string", "examples": ["./templates/ghost.html", "/opt/tpl/ghost.htm"]}, "name": {"type": "string", "examples": ["ghost"]}, "content": {"type": "string", "examples": ["<html><body>{{ code }}: {{ message }}</body></html>"]}}, "additionalProperties": false}
1.0.schema.json
path
Path to the template file
{"type": "string", "examples": ["./templates/ghost.html", "/opt/tpl/ghost.htm"]}
1.0.schema.json
name
Template name (optional, if path is defined)
{"type": "string", "examples": ["ghost"]}
1.0.schema.json
content
Template content, if path is not defined
{"type": "string", "examples": ["<html><body>{{ code }}: {{ message }}</body></html>"]}
1.0.schema.json
formats
Responses, based on requested content-type format
{"type": "object", "properties": {"json": {"type": "object", "properties": {"content": {"type": "string", "examples": ["{\"error\": true, \"code\": {{ code | json }}, \"message\": {{ message | json }}}"]}}, "additionalProperties": false}, "xml": {"type": "object", "properties": {"content": {"type": "string", "examples": ["<?xml version=\"1.0\" encoding=\"utf-8\"?><error><code>{{ code }}</code><message>{{ message }}</message></error>"]}}, "additionalProperties": false}}, "additionalProperties": false}
1.0.schema.json
json
JSON format
{"type": "object", "properties": {"content": {"type": "string", "examples": ["{\"error\": true, \"code\": {{ code | json }}, \"message\": {{ message | json }}}"]}}, "additionalProperties": false}
1.0.schema.json
content
JSON response body (template tags are allowed here)
{"type": "string", "examples": ["{\"error\": true, \"code\": {{ code | json }}, \"message\": {{ message | json }}}"]}
1.0.schema.json
xml
XML format
{"type": "object", "properties": {"content": {"type": "string", "examples": ["<?xml version=\"1.0\" encoding=\"utf-8\"?><error><code>{{ code }}</code><message>{{ message }}</message></error>"]}}, "additionalProperties": false}
1.0.schema.json
content
XML response body (template tags are allowed here)
{"type": "string", "examples": ["<?xml version=\"1.0\" encoding=\"utf-8\"?><error><code>{{ code }}</code><message>{{ message }}</message></error>"]}
1.0.schema.json
pages
Error pages (codes)
{"type": "object", "patternProperties": {"^[a-zA-Z0-9_-]+$": {"type": "object", "properties": {"message": {"type": "string", "examples": ["Bad Request"]}}, "additionalProperties": false}}, "additionalProperties": false}
1.0.schema.json
^[a-zA-Z0-9_-]+$
Error page (code)
{"type": "object", "properties": {"message": {"type": "string", "examples": ["Bad Request"]}}, "additionalProperties": false}