Open wizardpisces opened 1 year ago
Huh, can you look into why ID is being ignored?
Huh, can you look into why ID is being ignored?
No idea why it's designed like this, but I searched source code and got below discover
In ts-json-schema-generator, DefinitionTypeFormatter and ReferenceTypeFormatter hard coded '#/definition' as prefix
While in typescript-json-schema, $id will be used as prefix
Since ts-json-schema-generator is an extended version of typescript-json-schema, so I think their basic behavior should be same?
Yeah, looks like we accidentally broke that at some point. Let's fix it.
Would you like to start a PR? I'm happy to review it
How to produce
ts-json-schema-generator -f './tsconfig.json' -p './type.ts' -o './scheme.json' --id='api'
./type.ts
What to expect?
./schema.json
What is actually happening?
./schema.json
Is this by design?
I think it's a serious bug, because it sabotages the combination with ajv validation
By the way typescript-json-schema can generate the expected result