ew.dev/Docs/Guides/Structured Content

Structured Content

Define, validate, and query structured content models in Document Authoring.

Structured content lets you back a document with a schema instead of free-form prose, so fields are typed, validated, and queryable rather than just formatted text.

Defining a model

Models are written in a documented subset of JSON Schema 2020-12. Every node needs an explicit type and a human-readable title. Use $defs to define reusable shapes and $ref to point at them within the same document:

{
  "$defs": {
    "Address": {
      "type": "object",
      "title": "Address",
      "properties": { "city": { "type": "string", "title": "City" } }
    }
  },
  "properties": {
    "shipping": { "$ref": "#/$defs/Address" }
  }
}

Validation keys

  • minLength / maxLength — string bounds
  • minimum / maximum — numeric bounds
  • minItems / maxItems — array size limits
  • pattern — a regex, e.g. "^[a-z0-9-]+$"
  • enum — a closed set of values, rendered as a dropdown in the editor
  • required — an array naming mandatory fields

metadata and section-metadata are reserved words and can't be reused as your own schema keys.

Creating and managing schemas

Schemas are authored through the Schema Editor app at https://da.live/apps/schema. They're stored under /{ORG}/{SITE}/.da/forms/schemas/, but should only be edited through that app, not by hand. To turn on the structured-content editor for a folder, set the config key editor.path to /{ORG}/{SITE}/{FOLDER}=https://da.live/form# — add one entry per folder that needs it.

Querying structured content

To list many structured documents at once, define a query-index in helix-query.yaml at the repository root, selecting each field by the id assigned to it in the rendered form markup:

properties:
  fieldName:
    select: div > div > div:has(#fieldName) > div:last-child
    value: textContent(el)

Reading data programmatically

Published and preview data is exposed as JSON at https://da-sc.adobeaem.workers.dev/{ENVIRONMENT}/{ORG}/{SITE}/{PATH} (environment is live or preview, and the path omits its file extension). Protected content needs an authorization: token {TOKEN} header. Empty strings, arrays, and objects are treated as absent and stripped from the saved document, and $ref expansion is capped at 10 levels to guard against circular schemas.

Building your own tooling

The da-sc-sdk package exposes validateSchema, validateData, convertJsonToHtml, and convertHtmlToJson, plus a createEngine helper, for anyone building custom editors or import pipelines on top of the same model format.

Read more

docs.da.live/developers/guides/structured-content