Skip to main content

Overview

There are three main approaches to integrate Digital Planning Data schemas into your application, each suited for different use cases and development workflows.

Integration Options

Reference Hosted Schema Files

The simplest integration method is to reference the hosted schema files directly. This approach requires no installation and always points to a specific version.
const schemaUrl = `https://theopensystemslab.github.io/digital-planning-data-schemas/<VERSION>/schemas/<SCHEMA>.json`;
Example: Fetching the Application Schema
// Fetch the latest application schema
const response = await fetch(
  'https://theopensystemslab.github.io/digital-planning-data-schemas/@next/schemas/application.json'
);
const applicationSchema = await response.json();
Available Schemas:
  • application.json - Full planning applications
  • preApplication.json - Pre-application submissions
  • prototypeApplication.json - Prototype applications
  • postSubmissionApplication.json - Post-submission data
  • postSubmissionPublishedApplication.json - Published applications
  • enforcement.json - Enforcement cases
Replace <VERSION> with a specific version number or use @next for the latest development version.

Version Management

The schemas follow semantic versioning. The repository structure maintains versions:
  • main branch: Reflects the @next version (development)
  • dist branch: Contains released versions with documentation
  • GitHub Releases: Tagged versions available at specific URLs
// Use a specific version
const v0_7_7 = 'https://theopensystemslab.github.io/digital-planning-data-schemas/0.7.7/schemas/application.json';

// Use the latest development version
const latest = 'https://theopensystemslab.github.io/digital-planning-data-schemas/@next/schemas/application.json';

Schema Validation Libraries

The schemas are JSON Schema Draft 07 compliant and work with standard validation libraries:
import Ajv from 'ajv';
import addFormats from 'ajv-formats';
import applicationSchema from 'digital-planning-data-schemas/schemas/application.json';

// Initialize AJV with format support
const ajv = addFormats(new Ajv({allowUnionTypes: true}));
const validate = ajv.compile(applicationSchema);

// Validate data
const isValid = validate(applicationData);
if (!isValid) {
  console.error(validate.errors);
}
When using AJV, remember to include ajv-formats for proper validation of email, date-time, UUID, and other format types used in the schemas.

Next Steps

Validation Patterns

Learn how to validate data against the schemas

TypeScript Types

Discover how to use TypeScript types effectively

Examples

Explore real-world implementation examples

API Implementation

Guidelines for implementing schemas in APIs

Build docs developers (and LLMs) love