From 0ec45687acf28df153f37d6d4f386f02c9736659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Trzci=C5=84ski?= Date: Tue, 18 Feb 2025 10:18:22 +0100 Subject: [PATCH] [#72423] test: example yaml schema --- src/index.html | 3 +- src/public/project.json | 139 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 src/public/project.json diff --git a/src/index.html b/src/index.html index 7fcc2ec..1ab5f83 100644 --- a/src/index.html +++ b/src/index.html @@ -266,8 +266,9 @@ action: () => alert("Custom button action"), }, ]), - spellcheckOpts: { dict: "en_US", dictionaryPath: `${window.location.pathname}dictionaries` }, + // spellcheckOpts: { dict: "en_US", dictionaryPath: `${window.location.pathname}dictionaries` }, syncScroll: true, + yamlSchema: `${window.location.origin}${window.location.pathname.split("/").slice(0, -1).join("/")}/project.json`, }, document.getElementById("myst"), ); diff --git a/src/public/project.json b/src/public/project.json new file mode 100644 index 0000000..10c9e40 --- /dev/null +++ b/src/public/project.json @@ -0,0 +1,139 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://designer.antmicro.com/project.schema.json", + "title": "Project", + "description": "Project definition for System Designer", + "type": "object", + "properties": { + "description": { + "description": "Project description", + "type": "string" + }, + "company": { + "description": "The project's customer", + "type": "string" + }, + "docs": { + "description": "Project documentation URL", + "type": "string", + "format": "uri" + }, + "research": { + "description": "Is this a research project", + "type": "boolean" + }, + "devices": { + "description": "Devices in this project", + "type": "object", + "patternProperties": { + "^.*$": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "description": "Device type", + "type": "string" + }, + "contains": { + "description": "Other devices contained in this one", + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "description": "Device description", + "type": "string" + }, + "soc": { + "description": "Soc contained in device", + "type": "string" + }, + "hw_repo": { + "description": "Git repository for device", + "type": "string", + "format": "uri" + }, + "image": { + "description": "Device image", + "type": "string", + "format": "uri" + } + }, + "additionalProperties": false + }, + { + "type": "string" + } + ] + } + } + }, + "software": { + "description": "Software in this project", + "type": "object", + "patternProperties": { + "^.*$": { + "type": "object", + "properties": { + "what": { + "description": "Software type (determines icon, defaults to 'other')", + "type": "string", + "enum": ["kenning", "linux", "openroad", "other", "rdfm", "renode", "u-boot", "xls", "zephyr"] + }, + "description": { + "description": "Device description", + "type": "string" + }, + "repos": { + "description": "Repositories for this software", + "type": "object", + "patternProperties": { + "^.*$": { + "type": "string" + } + } + }, + "repo": { + "description": "Repository for this software", + "type": "string" + }, + "targets": { + "description": "Devices this software targets", + "type": "string" + } + }, + "additionalProperties": false + } + } + }, + "requirements": { + "description": "Project requirements", + "type": "object", + "patternProperties": { + "^.*$": { + "type": "string" + } + } + }, + "allocations": { + "description": "Project allocations", + "type": "object", + "patternProperties": { + "^SoW_[0-9]+$": { + "type": "object", + "patternProperties": { + "^[0-9]{4}-w[0-9]{2}$": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "required": ["description", "company"] +}