diff --git a/.gitignore b/.gitignore index f193069..3c815ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -tsp-output/* -node_modules/* -dist/* -src-tsp/modules/* \ No newline at end of file +tsp-output/ +node_modules/ +dist/ +src-tsp/modules/ diff --git a/fetchModuleSchemas.js b/fetchModuleSchemas.js index 6f56858..02cbf22 100644 --- a/fetchModuleSchemas.js +++ b/fetchModuleSchemas.js @@ -41,5 +41,12 @@ for (const module of modules) { fs.writeFileSync(`${modulesDir}/index.tsp`, moduleImports.map(m => `import "./${m}";`).join("\n") + ` -alias RepoModule = ${moduleModels.map(m => `${m}Module`).join(" | ")};` -) \ No newline at end of file +import "@typespec/json-schema"; + +using TypeSpec.JsonSchema; + +@oneOf +union RepoModule { +${moduleModels.map(m => ` ${m}Module`).join(",\n")} +}` +)