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

Duplicating Java Classes when generating from JSON Schema #1151

Closed
ghost opened this issue Aug 19, 2020 · 1 comment
Closed

Duplicating Java Classes when generating from JSON Schema #1151

ghost opened this issue Aug 19, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Aug 19, 2020

Hi,

I'm running the maven plugin against my JSON Schemas and it end up creating duplicated classes (with _1 in the suffix).
Is there anyway to tell the plugin to look for a java class before generating it? I do not know whether the problem is within the JSON Schema (multiple files that defines the same object) or the plugin should threat that (the latter would be nice to have).

Thanks!

@joelittlejohn
Copy link
Owner

If you jsonschema2pojo to reuse an existing definition, you need to use a $ref. We don't do anything to deduplicate things that appear to be similar.

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

1 participant