Skip to content

Forms Template JSON Schema v2.1.0

Spencer Rose edited this page Jul 16, 2025 · 1 revision

Klamm Form Template Schema

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://klamm.social.gov.bc.ca/new-forms-schema.json",
  "title": "Klamm Form Definition",
  "description": "Schema for defining a complete form based on the Klamm data model ERD (v2.0).",
  "version": "2.1.0",
  "type": "object",
  "required": [
    "formId",
    "formTitle",
    "data"
  ],
  "properties": {
    "formId": {
      "type": "string",
      "description": "Unique identifier for the form, maps to Forms.form_id."
    },
    "formTitle": {
      "type": "string",
      "description": "The title of the form, maps to Forms.form_title."
    },
    "ministryId": {
      "type": ["integer", "null"],
      "description": "Optional: The ID of the ministry, maps to Forms.ministry_id."
    },
    "description": {
      "type": ["string", "null"],
      "description": "Optional: Purpose description of the form, maps to Forms.form_purpose."
    },
    "notes": {
      "type": ["string", "null"],
      "description": "Optional: General notes about the form, maps to Forms.notes."
    },
    "formFrequenciesId": {
      "type": ["integer", "null"],
      "description": "Optional: Foreign key to form_frequencies table, maps to Forms.form_frequency_id."
    },
    "formReachesId": {
      "type": ["integer", "null"],
      "description": "Optional: Foreign key to form_reaches table, maps to Forms.form_reach_id."
    },
    "printReason": {
      "type": ["string", "null"],
      "description": "Optional: Reason for printing, maps to Forms.print_reason."
    },
    "retentionNeeds": {
      "type": ["integer", "null"],
      "description": "Optional: Retention needs, maps to Forms.retention_needs."
    },
    "icmNonInteractive": {
      "type": ["boolean", "null"],
      "description": "Optional: Indicates if ICM is non-interactive, maps to Forms.icm_non_interactive."
    },
    "footerFragmentPath": {
      "type": ["string", "null"],
      "description": "Optional: Path to the footer fragment, maps to Forms.footer_fragment_path."
    },
    "dcvMaterialNumber": {
      "type": ["string", "null"],
      "description": "Optional: DCV material number, maps to Forms.dcv_material_number."
    },
    "orbeonFunctions": {
      "type": ["string", "null"],
      "description": "Optional: Orbeon functions, maps to Forms.orbeon_functions."
    },
    "icmGenerated": {
      "type": ["boolean", "null"],
      "description": "Optional: Indicates if ICM generated, maps to Forms.icm_generated."
    },
    "program": {
      "type": ["string", "null"],
      "description": "Optional: Program associated with the form, maps to Forms.program."
    },
    "decommissioned": {
      "type": "boolean",
      "description": "Optional: Indicates if the form is decommissioned, maps to Forms.decommissioned."
    },
    "fillTypeId": {
      "type": ["integer", "null"],
      "description": "Optional: Foreign key to fill_types table, maps to Forms.fill_type_id."
    },
    "version": {
      "type": "object",
      "description": "Details about this specific form version, maps to FormVersions.",
      "required": [
        "versionNumber",
        "status"
      ],
      "properties": {
        "versionNumber": {
          "type": "integer",
          "description": "Version number, maps to FormVersions.version_number."
        },
        "status": {
          "type": "string",
          "enum": ["draft", "approved", "final"],
          "description": "Status of the form version, maps to FormVersions.status."
        },
        "formDeveloperId": {
          "type": ["integer", "null"],
          "description": "Optional: ID of the form developer, maps to FormVersions.form_developer_id."
        },
        "comments": {
          "type": ["string", "null"],
          "description": "Optional: Comments about the form version, maps to FormVersions.comments."
        },
        "pdfTemplateName": {
          "type": ["string", "null"],
          "description": "Optional: Name of the PDF template, maps to FormVersions.pdf_template_name."
        },
        "pdfTemplateVersion": {
          "type": ["string", "null"],
          "description": "Optional: Version of the PDF template, maps to FormVersions.pdf_template_version."
        },
        "pdfTemplateParameters": {
          "type": ["string", "null"],
          "description": "Optional: Parameters for the PDF template, maps to FormVersions.pdf_template_parameters."
        },
        "usesPetsTemplate": {
          "type": ["boolean", "null"],
          "description": "Optional: Indicates if the form version uses the PETS template, maps to FormVersions.uses_pets_template."
        }
      }
    },
    "deployments": {
      "type": "array",
      "description": "List of deployments for this form version, maps to FormDeployments.",
      "items": {
        "$ref": "#/definitions/formDeployment"
      }
    },
    "stylesheets": {
      "type": "array",
      "description": "List of stylesheets applied to this form version, maps to public.style_sheets.",
      "items": {
        "$ref": "#/definitions/formStylesheet"
      }
    },
    "scripts": {
      "type": "array",
      "description": "List of scripts applied to this form version, maps to FormScripts.",
      "items": {
        "$ref": "#/definitions/formScript"
      }
    },
    "data": {
      "type": "array",
      "description": "The root elements of the form structure, maps to FormElements.",
      "items": {
        "$ref": "#/definitions/formElement"
      }
    },
    "businessAreas": {
      "type": "array",
      "description": "Optional: Business areas associated with the form, maps to form_business_area and business_areas.",
      "items": {
        "$ref": "#/definitions/formBusinessArea"
      }
    },
    "links": {
      "type": "array",
      "description": "Optional: External links associated with the form, maps to FormLinks.",
      "items": {
        "$ref": "#/definitions/formLink"
      }
    },
    "locations": {
      "type": "array",
      "description": "Optional: Locations where the form is available, maps to form_form_location and form_locations.",
      "items": {
        "$ref": "#/definitions/formLocation"
      }
    },
    "relatedForms": {
      "type": "array",
      "description": "Optional: Other forms related to this form, maps to FormRelatedForms.",
      "items": {
        "$ref": "#/definitions/formRelatedForm"
      }
    },
    "repositories": {
      "type": "array",
      "description": "Optional: Repositories where the form is stored, maps to form_repository_form and form_repositories.",
      "items": {
        "$ref": "#/definitions/formRepository"
      }
    },
    "softwareSources": {
      "type": "array",
      "description": "Optional: Software sources associated with the form, maps to form_software_source_form and form_software_sources.",
      "items": {
        "$ref": "#/definitions/formSoftwareSource"
      }
    },
    "userTypes": {
      "type": "array",
      "description": "Optional: User types associated with the form, maps to form_user_type and user_types.",
      "items": {
        "$ref": "#/definitions/formUserType"
      }
    },
    "approvalRequests": {
      "type": "array",
      "description": "Optional: Approval requests for this form version, maps to FormApprovalRequests.",
      "items": {
        "$ref": "#/definitions/formApprovalRequest"
      }
    },
    "workbenchPaths": {
      "type": "array",
      "description": "Optional: Workbench paths associated with the form, maps to FormWorkbenchPaths.",
      "items": {
        "$ref": "#/definitions/formWorkbenchPath"
      }
    },
    "dataSources": {
      "type": "array",
      "description": "Optional: Data sources used by this form version, maps to form_versions_form_data_sources and form_data_sources.",
      "items": {
        "$ref": "#/definitions/formDataSource"
      }
    }
  },
  "definitions": {
    "formDeployment": {
      "type": "object",
      "required": [
        "environment",
        "deployedAt"
      ],
      "properties": {
        "environment": {
          "type": "string",
          "enum": ["test", "dev", "prod"],
          "description": "Deployment environment, maps to FormDeployments.environment."
        },
        "deployedAt": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp of deployment, maps to FormDeployments.deployed_at."
        }
      }
    },
    "formStylesheet": {
      "type": "object",
      "required": [
        "name",
        "type"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the stylesheet, maps to StyleSheets.name."
        },
        "type": {
          "type": "string",
          "enum": ["web", "pdf"],
          "description": "Type of stylesheet (web or pdf), maps to StyleSheets.type."
        },
        "description": {
          "type": ["string", "null"],
          "description": "Optional: Description of the stylesheet, maps to StyleSheets.description."
        },
        "filepath": {
          "type": ["string", "null"],
          "description": "Optional: File path of the stylesheet, maps to StyleSheets.filepath."
        },
        "s3Key": {
          "type": ["string", "null"],
          "description": "Optional: S3 key for the stylesheet, maps to StyleSheets.s3_key."
        }
      }
    },
    "formScript": {
      "type": "object",
      "required": [
        "filename",
        "type"
      ],
      "properties": {
        "filename": {
          "type": "string",
          "description": "Filename of the script, maps to FormScripts.filename."
        },
        "type": {
          "type": "string",
          "description": "Type of script (web or pdf), maps to FormScripts.type."
        }
      }
    },
    "formFieldDataBinding": {
      "type": "object",
      "required": [
        "path"
      ],
      "properties": {
        "path": {
          "type": "string",
          "description": "The data binding path, maps to FormElementDataBindings.path."
        },
        "order": {
          "type": "integer",
          "description": "Order of the data binding, maps to FormElementDataBindings.order."
        }
      }
    },
    "baseFormElement": {
      "type": "object",
      "required": [
        "uuid",
        "name",
        "elementType"
      ],
      "properties": {
        "uuid": {
          "type": "string",
          "format": "uuid",
          "description": "Unique UUID for the element instance, maps to FormElements.uuid."
        },
        "name": {
          "type": "string",
          "description": "Name of the form element, maps to FormElements.name."
        },
        "parentId": {
          "type": ["string", "null"],
          "format": "uuid",
          "description": "Optional: UUID of the parent element, maps to FormElements.parent_id."
        },
        "description": {
          "type": ["string", "null"],
          "description": "Optional: Description of the form element, maps to FormElements.description."
        },
        "order": {
          "type": "integer",
          "description": "Order of the form element, maps to FormElements.order."
        },
        "elementType": {
          "type": "string",
          "description": "The type of form element, maps to FormElements.elementable_type."
        },
        "helpText": {
          "type": ["string", "null"],
          "description": "Optional: Help text for the form element, maps to FormElements.help_text."
        },
        "calculatedValue": {
          "type": ["string", "null"],
          "description": "Optional: Calculated value for the form element, maps to FormElements.calculated_value."
        },
        "isReadOnly": {
          "type": "boolean",
          "description": "Optional: Indicates if the form element is read-only, maps to FormElements.is_read_only."
        },
        "saveOnSubmit": {
          "type": "boolean",
          "description": "Optional: Indicates if the form element saves on submit, maps to FormElements.save_on_submit."
        },
        "visibleWeb": {
          "type": "boolean",
          "description": "Optional: Indicates if the form element is visible on web, maps to FormElements.visible_web."
        },
        "visiblePdf": {
          "type": "boolean",
          "description": "Optional: Indicates if the form element is visible on PDF, maps to FormElements.visible_pdf."
        },
        "isTemplate": {
          "type": "boolean",
          "description": "Optional: Indicates if the form element is a template, maps to FormElements.is_template."
        },
        "isRequired": {
          "type": "boolean",
          "description": "Optional: Indicates if the form element is required, maps to FormElements.is_required."
        },
        "sourceElementId": {
          "type": ["integer", "null"],
          "description": "Optional: ID of the source element for template elements, maps to FormElements.source_element_id."
        },
        "referenceId": {
          "type": ["string", "null"],
          "description": "Optional: Reference ID for the form element, maps to FormElements.reference_id."
        }
      }
    },
    "buttonInputFormElement": {
      "type": "object",
      "allOf": [{ "$ref": "#/definitions/baseFormElement" }],
      "properties": {
        "elementType": { "const": "ButtonInputFormElements" },
        "label": {
          "type": "string",
          "description": "Label for the button, maps to ButtonInputFormElements.label."
        },
        "buttonType": {
          "type": "string",
          "enum": ["ghost", "primary", "secondary", "danger"],
          "description": "Maps to ButtonInputFormElements.button_type."
        }
      }
    },
    "checkboxInputFormElement": {
      "type": "object",
      "allOf": [{ "$ref": "#/definitions/baseFormElement" }],
      "properties": {
        "elementType": { "const": "CheckboxInputFormElements" },
        "label": {
          "type": "string",
          "description": "Label for the checkbox, maps to CheckboxInputFormElements.label."
        },
        "visibleLabel": {
          "type": "boolean",
          "description": "Optional: Indicates if the label is visible, maps to CheckboxInputFormElements.visible_label."
        }
      }
    },
    "containerFormElement": {
      "type": "object",
      "allOf": [{ "$ref": "#/definitions/baseFormElement" }],
      "properties": {
        "elementType": { "const": "ContainerFormElements" },
        "containerType": {
          "type": "string",
          "enum": ["page", "fieldset", "section"],
          "description": "Type of container, maps to ContainerFormElements.container_type."
        },
        "collapsible": {
          "type": "boolean",
          "description": "Optional: Indicates if the container is collapsible, maps to ContainerFormElements.collapsible."
        },
        "collapsedByDefault": {
          "type": "boolean",
          "description": "Optional: Indicates if the container is collapsed by default, maps to ContainerFormElements.collapsed_by_default."
        },
        "isRepeatable": {
          "type": "boolean",
          "description": "Optional: Indicates if the container is repeatable, maps to ContainerFormElements.is_repeatable."
        },
        "legend": {
          "type": ["string", "null"],
          "description": "Optional: Legend for the container, maps to ContainerFormElements.legend."
        },
        "elements": {
          "type": "array",
          "description": "Child elements within this container, maps to FormElements.parent_id.",
          "items": { "$ref": "#/definitions/formElement" }
        }
      }
    },
    "htmlFormElement": {
      "type": "object",
      "allOf": [{ "$ref": "#/definitions/baseFormElement" }],
      "properties": {
        "elementType": { "const": "HTMLFormElements" },
        "htmlContent": {
          "type": "string",
          "description": "Raw HTML content to embed, maps to HTMLFormElements.html_content."
        },
        "repeaterItemLabel": {
          "type": ["string", "null"],
          "description": "Optional: Label for repeater item, maps to HTMLFormElements.repeater_item_label."
        }
      }
    },
    "dateSelectInputFormElement": {
      "type": "object",
      "allOf": [{ "$ref": "#/definitions/baseFormElement" }],
      "properties": {
        "elementType": { "const": "DateSelectInputFormElements" },
        "placeholderText": {
          "type": ["string", "null"],
          "description": "Optional: Placeholder text for the date input, maps to DateSelectInputFormElements.placeholder_text."
        },
        "label": {
          "type": ["string", "null"],
          "description": "Label for the date input, maps to DateSelectInputFormElements.label."
        },
        "visibleLabel": {
          "type": "boolean",
          "description": "Optional: Indicates if the label is visible, maps to DateSelectInputFormElements.visible_label."
        },
        "repeaterItemLabel": {
          "type": ["string", "null"],
          "description": "Optional: Label for repeater item, maps to DateSelectInputFormElements.repeater_item_label."
        },
        "minDate": {
          "type": ["string", "null"],
          "format": "date",
          "description": "Optional: Minimum selectable date, maps to DateSelectInputFormElements.min_date."
        },
        "maxDate": {
          "type": ["string", "null"],
          "format": "date",
          "description": "Optional: Maximum selectable date, maps to DateSelectInputFormElements.max_date."
        },
        "defaultDate": {
          "type": ["string", "null"],
          "format": "date",
          "description": "Optional: Default date, maps to DateSelectInputFormElements.default_date."
        },
        "dateFormat": {
          "type": "string",
          "description": "Date format, maps to DateSelectInputFormElements.date_format."
        },
        "includeTime": {
          "type": "boolean",
          "description": "Optional: Indicates if time should be included, maps to DateSelectInputFormElements.include_time."
        }
      }
    },
    "formElement": {
      "oneOf": [
        { "$ref": "#/definitions/buttonInputFormElement" },
        { "$ref": "#/definitions/checkboxInputFormElement" },
        { "$ref": "#/definitions/containerFormElement" },
        { "$ref": "#/definitions/htmlFormElement" },
        { "$ref": "#/definitions/dateSelectInputFormElement" }
      ]
    },
    "formBusinessArea": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "ID of the business area, maps to BusinessAreas.id."
        },
        "name": {
          "type": "string",
          "description": "Name of the business area, maps to BusinessAreas.name."
        },
        "shortName": {
          "type": ["string", "null"],
          "description": "Optional: Short name of the business area, maps to BusinessAreas.short_name."
        },
        "description": {
          "type": ["string", "null"],
          "description": "Optional: Description of the business area, maps to BusinessAreas.description."
        }
      }
    },
    "formLink": {
      "type": "object",
      "required": [
        "link"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "description": "ID of the form link, maps to FormLinks.id."
        },
        "link": {
          "type": "string",
          "description": "The URL link, maps to FormLinks.link."
        }
      }
    },
    "formLocation": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "ID of the form location, maps to FormLocations.id."
        },
        "name": {
          "type": "string",
          "description": "Name of the form location, maps to FormLocations.name."
        },
        "description": {
          "type": ["string", "null"],
          "description": "Optional: Description of the form location, maps to FormLocations.description."
        }
      }
    },
    "formRelatedForm": {
      "type": "object",
      "required": [
        "relatedFormId"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "description": "ID of the form relationship, maps to FormRelatedForms.id."
        },
        "relatedFormId": {
          "type": "integer",
          "description": "ID of the related form, maps to FormRelatedForms.related_form_id."
        }
      }
    },
    "formRepository": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "ID of the form repository, maps to FormRepositories.id."
        },
        "name": {
          "type": "string",
          "description": "Name of the form repository, maps to FormRepositories.name."
        },
        "description": {
          "type": ["string", "null"],
          "description": "Optional: Description of the form repository, maps to FormRepositories.description."
        }
      }
    },
    "formSoftwareSource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "ID of the software source, maps to FormSoftwareSources.id."
        },
        "name": {
          "type": "string",
          "description": "Name of the software source, maps to FormSoftwareSources.name."
        },
        "description": {
          "type": ["string", "null"],
          "description": "Optional: Description of the software source, maps to FormSoftwareSources.description."
        }
      }
    },
    "formUserType": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "ID of the user type, maps to UserTypes.id."
        },
        "name": {
          "type": "string",
          "description": "Name of the user type, maps to UserTypes.name."
        },
        "description": {
          "type": ["string", "null"],
          "description": "Optional: Description of the user type, maps to UserTypes.description."
        }
      }
    },
    "formApprovalRequest": {
      "type": "object",
      "required": [
        "requesterId",
        "approverName",
        "approverEmail",
        "status"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "description": "ID of the approval request, maps to FormApprovalRequests.id."
        },
        "formVersionId": {
          "type": "integer",
          "description": "ID of the form version, maps to FormApprovalRequests.form_version_id."
        },
        "requesterId": {
          "type": "integer",
          "description": "ID of the requester, maps to FormApprovalRequests.requester_id."
        },
        "approverId": {
          "type": ["integer", "null"],
          "description": "Optional: ID of the approver, maps to FormApprovalRequests.approver_id."
        },
        "approverName": {
          "type": "string",
          "description": "Name of the approver, maps to FormApprovalRequests.approver_name."
        },
        "approverEmail": {
          "type": "string",
          "description": "Email of the approver, maps to FormApprovalRequests.approver_email."
        },
        "requesterNote": {
          "type": ["string", "null"],
          "description": "Optional: Requester's note, maps to FormApprovalRequests.requester_note."
        },
        "approverNote": {
          "type": ["string", "null"],
          "description": "Optional: Approver's note, maps to FormApprovalRequests.approver_note."
        },
        "webformApproval": {
          "type": "boolean",
          "description": "Indicates if webform approval is required, maps to FormApprovalRequests.webform_approval."
        },
        "pdfApproval": {
          "type": "boolean",
          "description": "Indicates if PDF approval is required, maps to FormApprovalRequests.pdf_approval."
        },
        "isKlammUser": {
          "type": "boolean",
          "description": "Indicates if the approver is a Klamm user, maps to FormApprovalRequests.is_klamm_user."
        },
        "status": {
          "type": "string",
          "enum": ["pending", "approved", "rejected"],
          "description": "Status of the approval request, maps to FormApprovalRequests.status."
        },
        "token": {
          "type": ["string", "null"],
          "description": "Optional: Token for the approval request, maps to FormApprovalRequests.token."
        },
        "approvedAt": {
          "type": ["string", "null"],
          "format": "date-time",
          "description": "Optional: Timestamp of approval, maps to FormApprovalRequests.approved_at."
        },
        "rejectedAt": {
          "type": ["string", "null"],
          "format": "date-time",
          "description": "Optional: Timestamp of rejection, maps to FormApprovalRequests.rejected_at."
        }
      }
    },
    "formWorkbenchPath": {
      "type": "object",
      "required": [
        "workbenchPath"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "description": "ID of the workbench path, maps to FormWorkbenchPaths.id."
        },
        "workbenchPath": {
          "type": "string",
          "description": "The workbench path, maps to FormWorkbenchPaths.workbench_path."
        }
      }
    },
    "formDataSource": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "description": "ID of the form data source, maps to FormDataSources.id."
        },
        "name": {
          "type": "string",
          "description": "Name of the data source, maps to FormDataSources.name."
        },
        "description": {
          "type": ["string", "null"],
          "description": "Optional: Description of the data source, maps to FormDataSources.description."
        },
        "type": {
          "type": ["string", "null"],
          "description": "Optional: Type of the data source (e.g., 'API'), maps to FormDataSources.type."
        },
        "endpoint": {
          "type": ["string", "null"],
          "description": "Optional: Endpoint URL for API data sources, maps to FormDataSources.endpoint."
        },
        "params": {
          "type": ["string", "null"],
          "description": "Optional: Parameters for the data source (JSON string), maps to FormDataSources.params."
        },
        "body": {
          "type": ["string", "null"],
          "description": "Optional: Request body for the data source (JSON string), maps to FormDataSources.body."
        },
        "headers": {
          "type": ["string", "null"],
          "description": "Optional: Headers for the data source (JSON string), maps to FormDataSources.headers."
        },
        "host": {
          "type": ["string", "null"],
          "description": "Optional: Host for the data source, maps to FormDataSources.host."
        },
        "order": {
          "type": "integer",
          "description": "Order of the data source for a form version, maps to FormVersionsFormDataSources.order."
        }
      }
    }
  }
}

Summary of changes:

Top-level properties (Forms Table):

  • description field's mapping clarified to Forms.form_purpose.
  • Added fillTypeId.
  • Added decommissioned.
  • Added program.
  • Corrected formFrequenciesId and formReachesId descriptions to point to form_frequency_id and form_reach_id respectively.
  • Updated retentionNeeds to be of type integer.
  • Updated icmNonInteractive and icmGenerated to allow null.
  • Renamed workbenchFooterFragmentPath to footerFragmentPath to match Forms.footer_fragment_path.

version object (FormVersions Table):

  • Removed uuid as it's not present in the form_versions table.
  • Added comments.
  • Added pdfTemplateName.
  • Added pdfTemplateVersion.
  • Added pdfTemplateParameters.
  • Added usesPetsTemplate.

New Top-level Arrays and their Definitions:

  • businessAreas: Reflects form_business_area and business_areas tables.
  • links: Reflects form_links table.
  • locations: Reflects form_form_location and form_locations tables.
  • relatedForms: Reflects form_related_forms table.
  • repositories: Reflects form_repository_form and form_repositories tables.
  • softwareSources: Reflects form_software_source_form and form_software_sources tables.
  • userTypes: Reflects form_user_type and assumed user_types table.
  • approvalRequests: Reflects form_approval_requests table.
  • workbenchPaths: Reflects form_workbench_paths table.
  • dataSources: Reflects form_versions_form_data_sources and form_data_sources tables.

Updated Form Element Definitions:

  • formStylesheet: Updated to reflect public.style_sheets table including filepath and s3Key.
  • formScript: Changed filepath to filename to match FormScripts.filename.
  • formFieldDataBinding: Removed formElementId and formDataSourceId from required fields, and changed dataBindingPath to path.
  • baseFormElement:
    • Changed token to uuid and made it required.
    • Added helpText.
    • Added calculatedValue.
    • Added isReadOnly.
    • Added saveOnSubmit.
    • Added visibleWeb.
    • Added visiblePdf.
    • Added isTemplate.
    • Added isRequired.
    • Added sourceElementId.
    • Added referenceId.
  • checkboxInputFormElement: Added visibleLabel.
  • containerFormElement: Added isRepeatable and legend.
  • htmlFormElement: Added repeaterItemLabel.
  • Added new dateSelectInputFormElement definition and included it in formElement.oneOf. The updated JSON schema is provided above. The task is complete.The JSON schema for your forms metadata has been updated to reflect the changes in your database schema, specifically for forms-related tables.

Here's a summary of the key updates:

Top-Level Form Properties

Several properties at the top level of the JSON schema, which map to the Forms database table, have been updated:

  • The description field's mapping has been clarified to Forms.form_purpose.
  • New properties fillTypeId, decommissioned, and program have been added to align with Forms.fill_type_id, Forms.decommissioned, and Forms.program respectively.
  • The descriptions for formFrequenciesId and formReachesId now correctly point to Forms.form_frequency_id and Forms.form_reach_id.
  • retentionNeeds is now explicitly typed as an integer.
  • icmNonInteractive and icmGenerated can now be null.
  • workbenchFooterFragmentPath has been renamed to footerFragmentPath to match Forms.footer_fragment_path.

Form Version Properties

The version object within the JSON schema, which corresponds to the FormVersions database table, has been adjusted:

  • The uuid property has been removed, as it is not present in the form_versions table in the database schema.
  • New properties comments, pdfTemplateName, pdfTemplateVersion, pdfTemplateParameters, and usesPetsTemplate have been added to reflect new columns in the FormVersions table.

New Top-Level Arrays and Definitions

Several new arrays and their corresponding definitions have been introduced to represent relationships and new tables in the database:

  • businessAreas: Represents associated business areas.
  • links: For external links related to the form.
  • locations: For locations where the form is available.
  • relatedForms: For other forms related to the current one.
  • repositories: For repositories where the form is stored.
  • softwareSources: For software sources associated with the form.
  • userTypes: For user types associated with the form.
  • approvalRequests: For approval requests related to the form version.
  • workbenchPaths: For workbench paths associated with the form.
  • dataSources: For data sources used by the form version.

Updated Form Element Definitions

Specific form element definitions have been refined to include new properties:

  • formStylesheet: Now includes filepath and s3Key properties, aligning with the public.style_sheets table.
  • formScript: filepath has been changed to filename to match the FormScripts.filename column.
  • formFieldDataBinding: dataBindingPath is now path, and formElementId and formDataSourceId are no longer required.
  • baseFormElement: This foundational definition for all form elements now uses uuid as a required field (instead of token), and includes new properties like helpText, calculatedValue, isReadOnly, saveOnSubmit, visibleWeb, visiblePdf, isTemplate, isRequired, sourceElementId, and referenceId.
  • checkboxInputFormElement: Now includes visibleLabel.
  • containerFormElement: Now includes isRepeatable and legend.
  • htmlFormElement: Now includes repeaterItemLabel.
  • A new definition, dateSelectInputFormElement, has been added and integrated into the formElement.oneOf structure, reflecting the date_select_input_form_elements table.

Clone this wiki locally