You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
program gives warning: Warning: file _./type/b.ts_ and _./type/a.ts_ contains the same name TypeNameOne with different schema will overrides each other
What is actually happening?
TypeNameOne from file b.ts overrides TypeNameOne from a.ts silently
./schema.json
Reason: It lacks filename namespace to differentiate same name when we generate json from many ts files to just one
Some Suggestion:
Is it possible to generate one type to one json file, a.ts-> a.json and b.ts->b.json
Give warning for user to determine
The text was updated successfully, but these errors were encountered:
wizardpisces
changed the title
Type override when compile same type name from different file
Type override when compile same type name from different ts file to one json schema
Jul 31, 2023
What's the tsconfig? I'm not sure yet this is actually a bug because type script would resolve what type is actually being used when you have another file that actually uses those two types. Does that make sense?
It has nothing to do with how to use type, I also think it makes sense to define same name in different file
My doubts is that when ts-json-schema-generator silently override same name when compile directory to one schema.json just make no sense, it would lose info
How to produce
`ts-json-schema-generator -f './tsconfig.json' -p './type/' -o './scheme.json'
./type/a.ts
./type/b.ts
What to expect?
program gives warning:
Warning: file _./type/b.ts_ and _./type/a.ts_ contains the same name TypeNameOne with different schema will overrides each other
What is actually happening?
TypeNameOne from file b.ts overrides TypeNameOne from a.ts silently
./schema.json
Reason: It lacks filename namespace to differentiate same name when we generate json from many ts files to just one
Some Suggestion:
The text was updated successfully, but these errors were encountered: