TypeScriptToLua icon indicating copy to clipboard operation
TypeScriptToLua copied to clipboard

Generate schema automatically

Open Zamiell opened this issue 1 year ago • 0 comments

Currently, the schema is edited by hand, which is prone to error and prone to becoming outdated.

Instead, in my projects, I use ts-json-schema-generator. You feed it the source file for a TypeScript interface, and it spits out the resulting .json file schema. And you do in your build step so that it is always up to date.

e.g. "build": "tsc && npm run build-lualib", --> "build": "tsc && npm run build-lualib && npm run generate-schema",

Zamiell avatar Jul 17 '22 15:07 Zamiell