There are three main approaches to integrate Digital Planning Data schemas into your application, each suited for different use cases and development workflows.
The simplest integration method is to reference the hosted schema files directly. This approach requires no installation and always points to a specific version.
Then reference schemas programmatically in your code:
import applicationSchema from './digital-planning-data-schemas/schemas/application.json';import {Application} from './digital-planning-data-schemas/types/schemas/application';// Use the schema for validationfunction validateApplication(data: unknown): data is Application { // Your validation logic here return true;}
// Import typesimport type {Application} from 'digital-planning-data-schemas/types/schemas/application';import type {CommentType} from 'digital-planning-data-schemas/types/schemas/postSubmissionApplication/enums/CommentType';// Import schemasimport applicationSchema from 'digital-planning-data-schemas/schemas/application.json';// Import examplesimport exampleData from 'digital-planning-data-schemas/examples/application/planningPermission/fullHouseholder.json';
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 versionconst v0_7_7 = 'https://theopensystemslab.github.io/digital-planning-data-schemas/0.7.7/schemas/application.json';// Use the latest development versionconst latest = 'https://theopensystemslab.github.io/digital-planning-data-schemas/@next/schemas/application.json';