Don't allow BaseClass props through schema
This commit is contained in:
parent
1149c12df1
commit
3c7b5f2656
Binary file not shown.
@ -71,6 +71,24 @@ function main() {
|
|||||||
const part = TJS.generateSchema(program, name, settings, [], generator);
|
const part = TJS.generateSchema(program, name, settings, [], generator);
|
||||||
if (!part) continue;
|
if (!part) continue;
|
||||||
|
|
||||||
|
// this is a hack. want some want to check if its a @column, instead
|
||||||
|
if (part.properties)
|
||||||
|
Object.keys(part.properties)
|
||||||
|
.filter((key) =>
|
||||||
|
[
|
||||||
|
// BaseClass methods
|
||||||
|
"toJSON",
|
||||||
|
"hasId",
|
||||||
|
"save",
|
||||||
|
"remove",
|
||||||
|
"softRemove",
|
||||||
|
"recover",
|
||||||
|
"reload",
|
||||||
|
"assign",
|
||||||
|
].includes(key),
|
||||||
|
)
|
||||||
|
.forEach((key) => delete part.properties[key]);
|
||||||
|
|
||||||
definitions = { ...definitions, [name]: { ...part } };
|
definitions = { ...definitions, [name]: { ...part } };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user