I have some json schema that I try to convert to pojo classes using jsonschema2pojo.
Unfortunately, I get some duplicated classes generated with an additional __1
postfix on the classname.
You can test this at https://www.jsonschema2pojo.org/.
Add this example and hit Preview
:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"something": {
"type": "object",
"properties": {}
},
"other": {
"type": "object",
"properties": {
"physical": {
"$ref": "#/properties/something"
}
}
}
}
}
I get the classes Something
and Something__1
. They have the same code (except the class name).
I found other questions, where someone commented that one can change some ObjectRule
and RuleFactory
, but I don't want to patch the library.
Is there something with my schema or is this a bug?