Production schema

Schema reference

This section defines the required objects, fields, types, and enums for production Forma documents. The JSON Schema file is the machine-checkable companion to this page.

Primary objects

  • FormaDocument
  • SourceRef
  • FormaNode
  • Layout
  • Style
  • Issue

Required enums

  • Node types: screen, component, container, text, image, icon
  • Roles: button, input, card, modal, nav, list, container, text, image
  • Layout types: flex, stack, absolute
  • Severity: info, warning, error
ObjectFieldTypeRequiredNotes
FormaDocumentversionstringYesSemantic version, v1 requires 1.x.y
FormaDocumentsourceSourceRefYesOriginating tool and file reference
FormaDocumentnodesFormaNode[]YesFlat node list with parent-child links
FormaDocumenttokensobjectNoOptional token dictionary
FormaDocumentissuesIssue[]NoDocument-level issues
SourceReftoolstringYesExample: figma, sketch
SourceReffileIdstringNoStable source file reference if available
FormaNodeidstringYesStable within document scope
FormaNodetypeenumYesOne of the required node types
FormaNodenamestringYesHuman-readable source or normalized name
FormaNoderoleenumNoSemantic role when known or inferred
FormaNodeparentIdstring|nullNoNull or absent for roots
FormaNodechildrenstring[]NoOrdered child node ids
FormaNodelayoutLayoutNoRequired for structural nodes unless not applicable
FormaNodestyleStyleNoToken-first style object
FormaNodetextstringNoAllowed on text nodes
FormaNodesourceSourceRefNoPer-node provenance
FormaNodeconfidencenumberNo0.0–1.0 inclusive
FormaNodeflagsstring[]NoAmbiguity, fallback, unsupported data markers
IssueseverityenumYesinfo, warning, error
IssuecodestringYesMachine-readable issue code
IssuemessagestringYesHuman-readable explanation
Canonical node exampleJSON
{
  "id": "cmp_button_primary",
  "type": "component",
  "name": "Button/Primary",
  "role": "button",
  "parentId": null,
  "children": ["txt_button_primary_label"],
  "layout": {
    "type": "flex",
    "direction": "row",
    "align": "center",
    "justify": "center",
    "gap": "{space.2}",
    "padding": {"x": "{space.4}", "y": "{space.2}"}
  },
  "style": {
    "background": "{color.brand.primary}",
    "text": "{typography.label.md}",
    "radius": "{radius.md}"
  },
  "confidence": 0.97,
  "flags": []
}

Machine validation

Use the shipped schema for validation in producers, CI, and third-party consumers.

Open JSON Schema