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
commit1c9f2ecdce847ed6892d69047285e34f558b6f5c (patch)
tree7336fb590bfcaf3be1af78af46567c1ac030ee89 /scripts
parentPrettier precommit hook (diff)
downloadserver-1c9f2ecdce847ed6892d69047285e34f558b6f5c.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 } };
 	}