json-schema-to-typescript icon indicating copy to clipboard operation
json-schema-to-typescript copied to clipboard

Disable `This interface was referenced by ...` comments with `--unreachableDefinitions`

Open relu91 opened this issue 2 years ago • 1 comments

As the title is saying I was wondering if it is possible to disable the generation of reference comments when --unreachableDefinitions is used. I had recently to enable this feature and I noticed that the generated TS file got polluted with all comments like the following:

/**
 * This interface was referenced by `AJsonSchema`'s JSON-Schema
 * via the `definition` "Adefinition".
 */

Why are these comments added? Can I disable them?

relu91 avatar Dec 15 '21 19:12 relu91

I pinpointed the place where this comment is added. Still, I don't understand why by default is not enabled and why with --unreachableDefinitions it is enabled. https://github.com/bcherny/json-schema-to-typescript/blob/8ea10a61f0d4b24749ae033a37f9aa3fb9a94417/src/parser.ts#L389-L400

relu91 avatar Jan 27 '22 14:01 relu91