Skip to content

Instantly share code, notes, and snippets.

@jroehl
Created May 30, 2023 11:00
Show Gist options
  • Save jroehl/3427a1c06c0c80ee3cd1c60ac06c2ea5 to your computer and use it in GitHub Desktop.
Save jroehl/3427a1c06c0c80ee3cd1c60ac06c2ea5 to your computer and use it in GitHub Desktop.
AppConfig
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"definitions": {
"AppDefinition": {
"additionalProperties": false,
"properties": {
"bundle": {
"$ref": "#/definitions/Link<\"AppBundle\">",
"description": "Link to an AppBundle"
},
"locations": {
"description": "Locations where the app can be installed",
"items": {
"anyOf": [
{
"$ref": "#/definitions/SimpleLocation"
},
{
"$ref": "#/definitions/EntryFieldLocation"
},
{
"$ref": "#/definitions/PageLocation"
}
]
},
"type": "array"
},
"name": {
"description": "App name",
"type": "string"
},
"parameters": {
"additionalProperties": false,
"description": "Instance parameter definitions",
"properties": {
"instance": {
"items": {
"$ref": "#/definitions/ParameterDefinition"
},
"type": "array"
}
},
"type": "object"
},
"src": {
"description": "URL where the root HTML document of the app can be found",
"type": "string"
}
},
"type": "object"
},
"AppInstallation": {
"additionalProperties": false,
"properties": {
"contentTypes": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"enum": ["*"],
"type": "string"
}
],
"description": "The content types that the app is installed for, or \"*\" for all content types"
},
"fields": {
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"description": "The fields of the content type where the app is installed, or undefined if not installed for any fields",
"type": "object"
},
"mappings": {
"$ref": "#/definitions/Mappings",
"description": "The app installation mappings (will be passed to the app installation parameters)"
},
"parameters": {
"description": "Free-form installation parameters (API limits stringified length to 16kB)",
"items": {
"$ref": "#/definitions/ParameterDefinition"
},
"type": "array"
},
"sidebar": {
"additionalProperties": false,
"description": "The location in the sidebar where the app is installed,\nor undefined if not installed in the sidebar",
"properties": {
"location": {
"description": "The index of the sidebar item",
"minimum": 0,
"type": "integer"
}
},
"type": "object"
}
},
"type": "object"
},
"AppPipeline": {
"additionalProperties": false,
"properties": {
"parameters": {
"additionalProperties": false,
"required": ["staging", "master"],
"properties": {
"staging": {
"description": "Free-form installation parameters that are passed to the staging app installation. Everything prefixed with 'gh-secret.<variable_name>' will be treated as a secret and will be taken from Github secrets",
"additionalProperties": true,
"type": "object"
},
"master": {
"description": "Free-form installation parameters that are passed to the production app installation Everything prefixed with 'gh-secret.<variable_name>' will be treated as a secret and will be taken from Github secrets",
"additionalProperties": true,
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
},
"DefinedParameters": {
"additionalProperties": false,
"type": "object"
},
"EntryFieldLocation": {
"additionalProperties": false,
"properties": {
"fieldTypes": {
"items": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"type": {
"enum": ["Symbol"],
"type": "string"
}
},
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"type": {
"enum": ["Text"],
"type": "string"
}
},
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"type": {
"enum": ["RichText"],
"type": "string"
}
},
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"type": {
"enum": ["Integer"],
"type": "string"
}
},
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"type": {
"enum": ["Number"],
"type": "string"
}
},
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"type": {
"enum": ["Date"],
"type": "string"
}
},
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"type": {
"enum": ["Boolean"],
"type": "string"
}
},
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"type": {
"enum": ["Object"],
"type": "string"
}
},
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"type": {
"enum": ["Location"],
"type": "string"
}
},
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"linkType": {
"enum": ["Asset"],
"type": "string"
},
"type": {
"enum": ["Link"],
"type": "string"
}
},
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"linkType": {
"enum": ["Entry"],
"type": "string"
},
"type": {
"enum": ["Link"],
"type": "string"
}
},
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"items": {
"additionalProperties": false,
"properties": {
"type": {
"enum": ["Symbol"],
"type": "string"
}
},
"type": "object"
},
"type": {
"enum": ["Array"],
"type": "string"
}
},
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"items": {
"additionalProperties": false,
"properties": {
"linkType": {
"enum": ["Entry"],
"type": "string"
},
"type": {
"enum": ["Link"],
"type": "string"
}
},
"type": "object"
},
"type": {
"enum": ["Array"],
"type": "string"
}
},
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"items": {
"additionalProperties": false,
"properties": {
"linkType": {
"enum": ["Asset"],
"type": "string"
},
"type": {
"enum": ["Link"],
"type": "string"
}
},
"type": "object"
},
"type": {
"enum": ["Array"],
"type": "string"
}
},
"type": "object"
}
]
},
"type": "array"
},
"location": {
"enum": ["entry-field"],
"type": "string"
}
},
"type": "object"
},
"Link<\"AppBundle\">": {
"additionalProperties": false,
"description": "Link is a reference object to another entity that can be resolved using tools such as contentful-resolve",
"properties": {
"sys": {
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"linkType": {
"enum": ["AppBundle"],
"type": "string"
},
"type": {
"enum": ["Link"],
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"LocationType": {
"enum": ["app-config", "dialog", "entry-editor", "entry-list", "entry-sidebar", "home", "page"],
"type": "string"
},
"Mappings": {
"additionalProperties": false,
"properties": {
"component": {
"additionalProperties": {
"type": "string"
},
"description": "The mappings between content types and components",
"type": "object"
},
"settings": {
"additionalProperties": {
"$ref": "#/definitions/DefinedParameters"
},
"description": "The mappings between field ids and settings",
"type": "object"
},
"widgets": {
"additionalProperties": {
"type": "string"
},
"description": "The mappings between field ids and widgets to be used",
"type": "object"
}
},
"type": "object"
},
"NavigationItem": {
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"path": {
"type": "string"
}
},
"type": "object"
},
"PageLocation": {
"additionalProperties": false,
"properties": {
"location": {
"enum": ["page"],
"type": "string"
},
"navigationItem": {
"$ref": "#/definitions/NavigationItem"
}
},
"type": "object"
},
"ParameterDefinition": {
"additionalProperties": false,
"properties": {
"default": {
"type": ["string", "number", "boolean"]
},
"description": {
"type": "string"
},
"id": {
"type": "string"
},
"labels": {
"additionalProperties": false,
"properties": {
"empty": {
"type": "string"
},
"false": {
"type": "string"
},
"true": {
"type": "string"
}
},
"type": "object"
},
"name": {
"type": "string"
},
"options": {
"items": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "string"
}
]
},
"type": "array"
},
"required": {
"type": "boolean"
},
"type": {
"$ref": "#/definitions/ParameterType"
}
},
"type": "object"
},
"ParameterType": {
"enum": ["Boolean", "Enum", "Number", "Symbol"],
"type": "string"
},
"SimpleLocation": {
"additionalProperties": false,
"properties": {
"location": {
"$ref": "#/definitions/LocationType"
}
},
"type": "object"
}
},
"properties": {
"$schema": {
"pattern": "(./)*app-config.schema.json$",
"type": "string"
},
"baseDir": {
"description": "The base dir of the app-config (will be set automatically during installation)",
"type": "string"
},
"definition": {
"$ref": "#/definitions/AppDefinition",
"description": "The app definition"
},
"installation": {
"$ref": "#/definitions/AppInstallation",
"description": "The installation parameters"
},
"pipeline": {
"$ref": "#/definitions/AppPipeline",
"description": "The installation parameters that are passed to the installation in the pipeline"
}
},
"type": "object"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment