DNA can be expressed with structured YAML
"$schema": https://json-schema.org/draft/2020-12/schema
title: ArticlePublished
description: Article is marked as published
version: '1.1'
type: object
properties:
title:
type: string
maxLength: 30
content:
type: string
published:
type: boolean
date_published:
type: string
format: date
author:
"$ref": "#/$defs/Author"
required:
- title
- content
additionalProperties: false
"$defs":
Author:
type: object
properties:
name:
type: string
email:
type: string
format: email
additionalProperties: false
DNA can also be expressed in JSON (schemas/objects use JSON Schema draft 2020-12)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ArticlePublished",
"description": "Article is marked as published",
"version": "1.1",
"type": "object",
"properties": {
"title": {
"type": "string",
"maxLength": 30
},
"content": {
"type": "string"
},
"published": {
"type": "boolean"
},
"date_published": {
"type": "string",
"format": "date"
},
"author": {
"$ref": "#/$defs/Author"
}
},
"required": [
"title",
"content"
],
"additionalProperties": false,
"$defs": {
"Author": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"email": {
"type": "string",
"format": "email"
}
},
"additionalProperties": false
}
}
}