wardcanyon / bga-effortlesswc

0 stars 0 forks source link

JsonSchema validation has some problems #1

Open kelleyk opened 1 week ago

kelleyk commented 1 week ago

The client_interface_schema.inc.php file is almost 90 MiB; and we have to increase our memory limit from 128 MiB to almost 1024 MiB in order to get our tests to run. (The out-of-memory errors happen at schema loading time.)

kelleyk commented 1 week ago

The following commands all yield very different results:

npx ts-json-schema-generator --tsconfig ./tmp/tsconfig.json --path client/types/{bga-common,actions,bga-dojo,bga-framework,bga-gamedatas,bga-notifs,notifs,state-args,state}.d.ts --out ./tmp/client/combined.json-schema ; du -sh ./tmp/client/combined.json-schema (this looks most like what we want)

npx ts-json-schema-generator --tsconfig ./tmp/tsconfig.json --path ./client/types/**/*.d.ts --out ./tmp/client/client_interface_schema.json-schema (this only includes the four notif types)

npx ts-json-schema-generator --tsconfig ./tmp/tsconfig.json --path "./client/types/**/*.d.ts" --out ./tmp/client/client_interface_schema.json-schema (this produces the 90 MiB blob that includes non-exported things like $)