{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://runbook-tutorials.invalid/schema/project/v0.1", "title": "Project or project template", "type": "object", "required": [ "spec", "id", "title", "runbooks" ], "additionalProperties": false, "properties": { "spec": { "enum": [ "project/v0.1", "project-template/v0.1" ] }, "id": { "type": "string", "pattern": "^[a-z0-9]+([.-][a-z0-9]+)*$" }, "title": { "type": "string", "minLength": 3 }, "goal": { "type": "string" }, "environment": { "enum": [ "rehearsal", "staging", "production" ] }, "template": { "type": "string", "description": "Id of the template this project was created from." }, "attribute_sets": { "type": "array", "items": { "type": "string" } }, "attributes": { "$ref": "#/$defs/attributes" }, "targets": { "type": "object", "propertyNames": { "pattern": "^[a-z][a-z0-9-]*$" }, "additionalProperties": { "type": "object", "additionalProperties": false, "properties": { "title": { "type": "string" }, "attribute_sets": { "type": "array", "items": { "type": "string" } }, "attributes": { "$ref": "#/$defs/attributes" } } } }, "runbooks": { "type": "array", "minItems": 1, "items": { "type": "object", "required": [ "pack" ], "additionalProperties": false, "properties": { "pack": { "type": "string" }, "target": { "type": "string" }, "after": { "type": "array", "items": { "type": "string" } }, "attributes": { "$ref": "#/$defs/attributes" } } } }, "description": { "type": "string", "description": "What this project is, in its own words. Not inherited from a template." } }, "allOf": [ { "if": { "properties": { "spec": { "const": "project/v0.1" } } }, "then": { "required": [ "environment" ] } } ], "$defs": { "attributes": { "type": "object", "propertyNames": { "pattern": "^[a-z][a-z0-9_]*$" }, "additionalProperties": { "$ref": "#/$defs/attribute" } }, "attribute": { "oneOf": [ { "type": [ "string", "integer", "boolean" ] }, { "type": "object", "additionalProperties": false, "properties": { "value": { "type": [ "string", "integer", "boolean" ] }, "requirement": { "enum": [ "required", "optional" ] }, "note": { "type": "string" } }, "minProperties": 1 } ] } } }