diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-01-06 18:05:26 +1100 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-01-06 18:07:14 +1100 |
commit | 1c9f2ecdce847ed6892d69047285e34f558b6f5c (patch) | |
tree | 7336fb590bfcaf3be1af78af46567c1ac030ee89 /scripts | |
parent | Prettier precommit hook (diff) | |
download | server-1c9f2ecdce847ed6892d69047285e34f558b6f5c.tar.xz |
Don't allow BaseClass props through schema
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/schema.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/schema.js b/scripts/schema.js index 29665ef1..fedbf25f 100644 --- a/scripts/schema.js +++ b/scripts/schema.js @@ -71,6 +71,24 @@ function main() { const part = TJS.generateSchema(program, name, settings, [], generator); 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 } }; } |