Skip to content

Instantly share code, notes, and snippets.

@erik4github
Last active October 15, 2021 19:24
Show Gist options
  • Save erik4github/621cf1ef946f4127e5ddf1f4a99b461c to your computer and use it in GitHub Desktop.
Save erik4github/621cf1ef946f4127e5ddf1f4a99b461c to your computer and use it in GitHub Desktop.
HubSpot CMS Modules JSON Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"title": "HubSpot Module",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The variable name you will use to refer to this field's values, and is what the value of the field is stored against. Cannot contain spaces or special characters.",
"pattern": "^\\w*$"
},
"label": {
"type": "string",
"description": "The text the content creator sees describing the field. May contain spaces."
},
"required": {
"type": "boolean",
"description": "Determines if the field can be left blank in the editor. If true, content will not be allowed to publish without filling out this field.",
"default": false
},
"locked": {
"type": "boolean",
"description": "Determines if the field is editable in the content editor. If true, the field will not appear in the content editor.",
"default": false
},
"inline_help_text": {
"type": "string",
"description": "Help text that will be shown inline below the label of the field (limit 300 chars).\n Best used for information required to use the field.",
"default": "null"
},
"help_text": {
"type": "string",
"description": "Text that will appear in the editor via tooltip to assist the content creator. \n Best used for information that is supplementary but not required to use the field."
},
"type": {
"type": "string",
"description": "The type of field, see [field types](https://developers.hubspot.com/en/docs/cms/building-blocks/module-theme-fields#field-types) for documentation on all field types."
},
"placeholder": {
"type": "string"
},
"visibility": {
"type": "array",
"description": "Determines the display conditions for a field."
},
"default": {
"type": [
"string",
"integer",
"array",
"boolean",
"null",
"number",
"object"
]
}
},
"if": {
"properties": {
"type": {
"const": "menu"
}
}
},
"then": {
"properties": {
"default": {
"description": "The menu ID for the menu. The default value of null, defaults to the default menu under navigation.",
"anyOf": [
{ "type": "integer" },
{ "type": "string", "const": "default" }
]
}
}
},
"else": {
"properties": {
"default": {
"description": "The default value of the field"
}
}
},
"required": [
"name",
"label",
"type"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment