YousefED / typescript-json-schema

Generate json-schema from your Typescript sources
BSD 3-Clause "New" or "Revised" License
3.17k stars 323 forks source link

fix: avoid unrelated schemaOverrides when building definition for single type #589

Closed lundibundi closed 9 months ago

lundibundi commented 9 months ago

Please:

I want to use setSchemaOverride to override some types and then generate separate schema files per type with getSchemaForSymbol. Current implementation adds all overrides to each schema even if they are not used. This PR removes that behavior by default and adds an option includeAllOverrides to return it. The includeAllOverrides is also enabled by default when generating schema for whole program.