Skip to content

Field Schema

This page shows the complete JSON schema for template fields, including all possible properties and their types.

The only required properties for a field are:

  • name - The field name/identifier
  • page - The page number (for PDF templates only)

All other properties are optional and will use the default values

The following schema is extracted from the DocSpring OpenAPI specification. It shows all available field properties, their types, and validation rules.

Field JSON Schema
{
"additionalProperties": false,
"properties": {
"alignment": {
"enum": [
"left",
"center",
"right"
],
"type": "string"
},
"autoCalculateMaxLength": {
"type": "boolean"
},
"backgroundColor": {
"type": "string"
},
"backgroundColorFieldName": {
"type": "string"
},
"backgroundColorFieldRequired": {
"type": "boolean"
},
"barcodeSymbology": {
"type": "string"
},
"bold": {
"type": "boolean"
},
"characterSpacing": {
"type": "number"
},
"checkCharacter": {
"enum": [
"✓",
"✔",
"✖",
"✗",
"✘"
],
"type": "string"
},
"checkColor": {
"type": "string"
},
"checkColorFieldName": {
"type": "string"
},
"checkColorFieldRequired": {
"type": "boolean"
},
"color": {
"type": "string"
},
"colorFieldName": {
"type": "string"
},
"colorFieldRequired": {
"type": "boolean"
},
"comb": {
"type": "boolean"
},
"combNumberOfCells": {
"minimum": 0,
"type": "number"
},
"combValueOffset": {
"type": "number"
},
"combinedFieldFormat": {
"type": "string"
},
"combinedFieldNames": {
"type": "string"
},
"combinedFieldSeparator": {
"type": "string"
},
"combinedFieldType": {
"type": "string"
},
"condition": {
"type": "string"
},
"currency": {
"type": "boolean"
},
"dateTimeFormat": {
"type": "string"
},
"decimalPlaces": {
"minimum": 0,
"type": "number"
},
"default": {
"type": "string"
},
"description": {
"type": "string"
},
"displayType": {
"enum": [
"text",
"check",
"qrcode",
"barcode",
"image",
"shape"
],
"type": "string"
},
"exclusiveMaximum": {
"type": "boolean"
},
"exclusiveMinimum": {
"type": "boolean"
},
"falseText": {
"type": "string"
},
"fontSize": {
"minimum": 0,
"type": "number"
},
"height": {
"minimum": 0,
"type": "number"
},
"hidden": {
"type": "boolean"
},
"id": {
"minimum": 0,
"type": "number"
},
"imageGravity": {
"enum": [
"NorthWest",
"North",
"NorthEast",
"West",
"Center",
"East",
"SouthWest",
"South",
"SouthEast"
],
"type": "string"
},
"imageScaleType": {
"enum": [
"fit",
"fill",
"stretch"
],
"type": "string"
},
"includeTime": {
"type": "boolean"
},
"integer": {
"type": "boolean"
},
"invertBooleanCondition": {
"type": "boolean"
},
"maxLength": {
"type": "number"
},
"maximum": {
"type": "number"
},
"metadata": {
"type": "string"
},
"minLength": {
"type": "number"
},
"minimum": {
"type": "number"
},
"multiline": {
"type": "boolean"
},
"multilineLines": {
"minimum": 0,
"type": "number"
},
"name": {
"type": "string"
},
"numberConditionRangeExclusiveMax": {
"type": "boolean"
},
"numberConditionRangeExclusiveMin": {
"type": "boolean"
},
"numberConditionRangeMax": {
"type": "number"
},
"numberConditionRangeMin": {
"type": "number"
},
"numberConditionType": {
"enum": [
"equals",
"range",
"gte",
"gt",
"lte",
"lt"
],
"type": "string"
},
"opacity": {
"maximum": 1,
"minimum": 0,
"type": "number"
},
"optionList": {
"type": "string"
},
"overflow": {
"enum": [
"shrink_to_fit",
"truncate"
],
"type": "string"
},
"page": {
"minimum": 1,
"type": "number"
},
"placeholder": {
"type": "string"
},
"qrcodeColor": {
"type": "string"
},
"qrcodeColorFieldName": {
"type": "string"
},
"qrcodeColorFieldRequired": {
"type": "boolean"
},
"required": {
"type": "boolean"
},
"rotation": {
"maximum": 360,
"minimum": 0,
"type": "number"
},
"shapeBorderColor": {
"type": "string"
},
"shapeBorderColorFieldName": {
"type": "string"
},
"shapeBorderColorFieldRequired": {
"type": "boolean"
},
"shapeBorderWidth": {
"minimum": 0,
"type": "number"
},
"shapeFillColor": {
"type": "string"
},
"shapeFillColorFieldName": {
"type": "string"
},
"shapeFillColorFieldRequired": {
"type": "boolean"
},
"shapeType": {
"enum": [
"square",
"rectangle",
"circle",
"ellipse"
],
"type": "string"
},
"signatureAllowDraw": {
"type": "boolean"
},
"signatureAllowType": {
"type": "boolean"
},
"static": {
"type": "boolean"
},
"strikethrough": {
"type": "boolean"
},
"stringConditionType": {
"enum": [
"equals",
"contains",
"starts_with",
"ends_with",
"regex"
],
"type": "string"
},
"title": {
"type": "string"
},
"trueText": {
"type": "string"
},
"type": {
"enum": [
"string",
"number",
"boolean",
"date",
"address",
"country",
"email",
"url",
"image",
"signature",
"barcode",
"combined"
],
"type": "string"
},
"typeface": {
"type": "string"
},
"uppercase": {
"type": "boolean"
},
"vAlignment": {
"enum": [
"bottom",
"center",
"top"
],
"type": "string"
},
"width": {
"minimum": 0,
"type": "number"
},
"x": {
"minimum": 0,
"type": "number"
},
"y": {
"minimum": 0,
"type": "number"
}
},
"required": [
"name",
"page"
],
"type": "object"
}