From 3c7b5f2656b816aadaadc56f955ba5bd897a340a Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Fri, 6 Jan 2023 18:05:26 +1100 Subject: Don't allow BaseClass props through schema --- scripts/schema.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'scripts') 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 } }; } -- cgit 1.4.1