summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-01-06 18:05:26 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-01-06 18:07:14 +1100
commit3c7b5f2656b816aadaadc56f955ba5bd897a340a (patch)
tree4bff1151358fbcbe02c2b2c61b4ccb06e988bedf /scripts
parentPrettier precommit hook (diff)
downloadserver-3c7b5f2656b816aadaadc56f955ba5bd897a340a.tar.xz
Don't allow BaseClass props through schema
Diffstat (limited to 'scripts')
-rw-r--r--scripts/schema.js18
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 } };
 	}