I have a directory filled with JSON schemas, all coded in TypeScript.
My goal is to import them collectively while preserving the typing, instead of having to write out numerous import statements.
These schemas are utilized for validating JSON data being sent to my API using Ajv. I aim to align the endpoints of my API with the same structure as the schema names.
/users -> schemas/users.schema.ts
/account/stats -> schemas/account/stats.schema.ts
I possess an array containing various endpoint paths and would find it greatly beneficial if I could execute:
API.Mount("account/stats")
This means that essentially:
import `/schemas/${mount}.schema.ts` <-- import all these files