From d3e9fe057d406fb6723474c1aa94b1125b447849 Mon Sep 17 00:00:00 2001 From: Gerald Pinder Date: Sat, 26 Oct 2024 14:33:40 -0400 Subject: [PATCH] fix: Create separate entry unions for the module and stage lists --- src-tsp/main.tsp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src-tsp/main.tsp b/src-tsp/main.tsp index c656615..0cac2df 100644 --- a/src-tsp/main.tsp +++ b/src-tsp/main.tsp @@ -62,7 +62,13 @@ model StageList { * A list of [stages](https://blue-build.org/reference/stages/) that are executed before the build of the final image. * This is useful for compiling programs from source without polluting the final bootable image. */ - stages: Array; + stages: Array; +} + +@oneOf +union StageEntry { + Stage, + ImportedModule, } @jsonSchema("stage-v1.json") @@ -92,14 +98,19 @@ model ModuleList { * * Each item in this list should have at least a `type:` or be specified to be included from an external file in the `recipes/` directory with `from-file:`. */ - modules: Array; + modules: Array; +} + +union ModuleEntry { + Module, + ImportedModule, } @jsonSchema("module-v1.json") +@oneOf union Module { RepoModule, CustomModule, - ImportedModule, } model ModuleDefaults {