Skip to content

Properties Schema Examples v1.0.0

Guy Willis edited this page Jan 18, 2023 · 7 revisions

Examples

Following on from the property schema dissection, lets take a look at some examples of the differing types of schemas that can be used in v1.0.0 Authoring Tool schema.

String

"title": {
  "type": "string",
  "title": "Title",
  "default": "Untitled",
  "_adapt": {
    "translatable": true
  }
},
Screenshot 2023-01-16 at 17 06 30

String with Text Area

"body": {
  "type": "string",
  "title": "Body",
  "default": "",
  "_adapt": {
    "translatable": true
  },
  "_backboneForms": "TextArea"
},
Screenshot 2023-01-16 at 17 07 11

Number

"_left": {
  "type": "number",
  "title": "Pin horizontal position (%)",
  "description": "",
  "default": 0
},
Screenshot 2023-01-16 at 17 10 50

Boolean / Checkbox

"_isMobileTextBelowImage": {
  "type": "boolean",
  "title": "Move text area below image on mobile",
  "description": "If enabled, on mobile, the text area drops below the image instead of being behind the strapline button",
  "default": false,
  "_adapt": {
    "isSetting": true
  }
},
Screenshot 2023-01-16 at 17 29 09

Image

"src": {
  "type": "string",
  "isObjectId": true,
  "title": "Source",
  "description": "This is the image that appears behind the pins",
  "_backboneForms": {
    "type": "Asset",
    "media": "image"
  }
},
Screenshot 2023-01-16 at 17 29 41

Select

"_setCompletionOn": {
  "type": "string",
  "title": "Completion criteria",
  "description": "Whether completion is based on the learner having viewed all the narrative items - or just having viewed the component",
  "default": "allItems",
  "enum": [
    "inview",
    "allItems"
  ],
  "_backboneForms": "Select"
},
Screenshot 2023-01-16 at 17 31 00

Object

"_graphic": {
  "type": "object",
  "title": "Graphic",
  "default": {},
  "required": [
    "src"
  ],
  "properties": {
    ...
  }
}
Screenshot 2023-01-16 at 17 33 08

Array

"_items": {
  "type": "array",
  "title": "Items",
  "items": {
    ...
  }
}
Screenshot 2023-01-16 at 17 33 43

Adapt Specific properties

The _adapt keyword is used to group schema properties which are non-standard to the JSON schema specification and related to various Adapt-specific features (predominantly the).

"_adapt": {
  "editorOnly": true,
  "inputType": "Select",
  "isSetting": true,
  "showInUi": false,
  "translatable": true
}
Property Description
editorOnly Determines whether the attribute should be included in output JSON
inputType Determines the type of input rendered in forms (see Backbone Forms docs)
isSetting Attribute will appear in the ‘Settings’ section of the form
showInUi Determines whether the attribute will be rendered in forms
translatable Whether the attribute is a language-specific string for translation
Clone this wiki locally