joelittlejohn / jsonschema2pojo

Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc
http://www.jsonschema2pojo.org
Apache License 2.0
6.24k stars 1.66k forks source link

Different classes are generated for the same named attribute at a different JSONPath location #1559

Closed ulviugur closed 1 year ago

ulviugur commented 1 year ago

Hi,

I have the same attribute ("lastEdit") at different location in the JSON tree and POJO converter creates 2 different classes : LastEdit__1 and LastEdit.

Is there a way to declare that both of these attributes are the same and no need to create a dedicated new Class ? Could not find anything relevant in the "Reference" section.

Cheers, Geo

unkish commented 1 year ago

Hi

Is there a way to declare that both of these attributes are the same and no need to create a dedicated new Class ?

In case source type is JSON and the structure is similar to defined here then at present it's not possible

ulviugur commented 1 year ago

Yes, I use JSON as it is more practical / pragmatic.