New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add uniqueNames option. #151
Conversation
Can you add a test? |
I don't understand the test. It just tests whether string constants work, doesn't it? |
It tests whether different types of the same name can be obtained with the |
Thank you! Shouldn't this option be the default? Could you rebase against the latest master? |
Yes, probably this option could be default, but I wanted this pull request to be backward compatible. I will revisit this PR and will also resolve the conflicts. |
Thank you @fabiandev |
Could you rebase the branch so that I can merge it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great except for one question.
typescript-json-schema.ts
Outdated
@@ -854,6 +866,16 @@ export class JsonSchemaGenerator { | |||
return root; | |||
} | |||
|
|||
public getSymbols(): SymbolRef[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this method do here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought it may be more clear to use function overloading here. Could also be removed, since the implementation with the optional parameter should do.
Thank you! |
This is an approach to handle duplicate type names via the API, while preserving backward compatibility through the newly introduced option
uniqueNames
which defaults to false. Fixes #112.