Skip to content
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

Generating same class that appears few times in the JSON file #1562

Open
rushabh0701 opened this issue Sep 8, 2023 · 3 comments
Open

Generating same class that appears few times in the JSON file #1562

rushabh0701 opened this issue Sep 8, 2023 · 3 comments

Comments

@rushabh0701
Copy link

Hello all,

I have a JSON file that has a class called Invoice that appears multiple times and each time the library is generating the class for it. I now have class called Invoice, Invoice__1, Invoice__2, and Invoice__3. Is there a way to avoid generating the same class multiple times?

Thanks for the help!

@unkish
Copy link
Collaborator

unkish commented Sep 9, 2023

Hi

Could it be that given issue is duplicate of #1559 ?

@InfoSec812
Copy link

I am having a similar (same?) issue when parsing/generating from JSONSchema. I have a reproducer here: https://github.com/InfoSec812/asyncapi-java-parser

The Maven build downloads the files for the AsyncAPI Specification, rewrites the $ref links to be local file references, then generates the code in src/gen/java. I see that a few of the types are generating duplicates.

@InfoSec812
Copy link

I'm going to see if I can add a new option to merge duplicate POJOs without impacting the existing behavior. Probably and option like mergeDuplicates or something. Any hints on where to look would be appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants