Skip to content

Commit

Permalink
[#72423] test: example yaml schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Trzcin authored and mgielda committed Feb 18, 2025
1 parent e8fd321 commit 0ec4568
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
);
Expand Down
139 changes: 139 additions & 0 deletions src/public/project.json
Original file line number Diff line number Diff line change
@@ -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"]
}

0 comments on commit 0ec4568

Please sign in to comment.