Skip to content

Commit

Permalink
Add ADR "Include schema in stored data"
Browse files Browse the repository at this point in the history
  • Loading branch information
gregtyler committed Sep 11, 2023
1 parent 6ea60f5 commit 319160c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/architecture/decisions/0002-include-schema-in-stored-data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 2. Include schema in stored data

Date: 2023-09-11

## Status

Proposed

## Context

The data in this repository must be long lasting: an LPA registered in 2023 will still need to be valid for many years from now. For this to be possible, we will either need to migrate data over time or be able to handle it in its original form. Either way, it is essential that each object in the store is also clear about the shape that it takes.

## Decision

- In each object stored in the service, we will include a unique identifier which defines its schema
- The identifier will be a URI indicating a JSONSchema document defining the full definition of the schema
- In JSONPath syntax, the identifier will be stored in `/$schema`

## Consequences

This will give every data point in the store a clear schema, and leave us with no ambiguous data. This means that we can safely migrate any data which, importantly, means that we can always revisit this decision.

0 comments on commit 319160c

Please sign in to comment.