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

uniqueNames option conflicts with `getCanonicalDeclaration`

Open theoephraim opened this issue 4 years ago • 1 comments

I've been using this module quite successfully for a long time. I finally hit an issue with some naming conflicts and was very happy to discover the uniqueNames option. However when I turn this on, I am getting issues that I didn't have before with a getCanonicalDeclaration checks, for example: Symbol "ReadonlyArray" has no valueDeclaration and 5 declarations

Anyone experience this and solve it?

Tried moving over to https://github.com/vega/ts-json-schema-generator but that seems to have other issues that are dealbreakers.

theoephraim avatar Nov 16 '21 02:11 theoephraim

While the issue described above still remains, just in case someone in a similar situation stumbles across this, I was able to resolve my problems with naming conflicts by using an undocumented option and passing an array of specific files to include into the buildGenerator() function. This avoided the duplicate symbol names and sped up my build time a ton!

For example: TJS.buildGenerator(program, options, arrayOfFileNames)

theoephraim avatar Nov 16 '21 03:11 theoephraim