fix: Add additionalProperties = false for schemas
This commit is contained in:
parent
8b44a588a4
commit
08f1c4a9c3
2 changed files with 14 additions and 1 deletions
|
|
@ -21,12 +21,18 @@ for (const module of modules) {
|
|||
text = text // add `...ModuleDefaults;` after the model type
|
||||
.split("\n")
|
||||
.flatMap(line => {
|
||||
if (line.trimStart().startsWith("model")) {
|
||||
return [
|
||||
`@extension("additionalProperties", false)`,
|
||||
line
|
||||
];
|
||||
}
|
||||
if (line.trimStart().startsWith(`type: "${module.name}"`)) {
|
||||
return [
|
||||
line,
|
||||
'',
|
||||
' ...ModuleDefaults; // added by fetchModuleSchemas.js',
|
||||
]
|
||||
];
|
||||
} else {
|
||||
return line;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue