Development Setup
The JSON Schemas are defined using TypeScript interfaces and then generated using thets-json-schema-generator library.
Prerequisites
Assuming PNPM is available globally:Making Changes
To make changes to the schemas:- Update files in
/types - Run
pnpm buildto automatically generate the output JSON file under/schemas
Types should be annotated using JSDocs, which will then be read during schema generation.
Repository Structure
The repository is organized as follows:/examples
/examples
Examples of valid payloads for each application type supported by the specifications encoded in this repository.
/schemas
/schemas
The main JSON Schema files. The
main branch of this repo will reflect the @next version, while historic versions are documented and released on the dist branch./types
/types
TypeScript interfaces used to generate the JSON Schemas.
/tests
/tests
Test suites to ensure that the generated schema and example payloads are valid, accurate, and capable of handling different scenarios.
Adding Examples and Testing
Creating Examples
- Add a TypeScript file to
/examples/<SCHEMA>/datawith at least one exported variable representing an example payload definition - Run
pnpm build-json-examplesto automatically generate a corresponding JSON file per example payload in the root of/examples - Run
pnpm testto confirm your example payload can be successfully validated against the Digital Planning Data schema
Testing
Run the test suite to validate your changes:Publishing
To publish a new version:- Open a pull request against
mainwhich increments thepackage.jsonversion - On merge, the publish.yml GitHub Action will:
- Update the
distbranch - Create a release
- Publish the new version via GitHub pages at:
- Update the
API Implementation
For guidance on implementing the schema in an API, please refer to the API implementation guidelines.One of the aims of this specification is to make data interopable between systems. The schema allows us to do this with the structure but the implementation of API’s will also need to have standard implementations in order for applications to use the data efficiently.
Getting Help
If you have questions or need assistance:- Open an issue on GitHub
- Check the existing discussions
- Review the API implementation guidelines