fix: Change RepoModule into a union with oneOf
This commit is contained in:
parent
cd2ecc5f95
commit
8b44a588a4
2 changed files with 13 additions and 6 deletions
|
|
@ -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(" | ")};`
|
||||
)
|
||||
import "@typespec/json-schema";
|
||||
|
||||
using TypeSpec.JsonSchema;
|
||||
|
||||
@oneOf
|
||||
union RepoModule {
|
||||
${moduleModels.map(m => ` ${m}Module`).join(",\n")}
|
||||
}`
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue