appvision-gmbh / json2typescript

Map JSON to a TypeScript class with secure type checking!
https://www.npmjs.com/package/json2typescript
MIT License
278 stars 55 forks source link

Feature Request: Workaround for Duplicate Class Names Between Local Code and Dependency #189

Closed angad-singh15 closed 2 years ago

angad-singh15 commented 2 years ago

After reading your documentation, I understand that the @JsonObject decorator now requires the class identifier as the first parameter. However, one of my dependencies for my project also uses to Json2Typescript and has a conflicting class name with one of my own. Is there a way I can have Json2Typescript separate the use of the duplicate class names?

Thanks in advance!

andreas-aeschlimann commented 2 years ago

Have you thought about using a namespace for the class identifier?

For example you could use com.company.Classname instead of Classname as identifier.

andreas-aeschlimann commented 2 years ago

I also recommend to encourage the third-party dependency to use unique names for their class identifiers.

If you have something more to add, feel free to reopen the issue.