jsonschema2pojo
jsonschema2pojo copied to clipboard
Custom fragment path delimiters broken in 1.1.2
There appears to be a regression in v1.1.2 which is causing #688 not to behave as expected anymore. In v1.1.1, I'm able to generate POJOs from schemas like this:
{
"$schema" : "https://json-schema.org/draft/2020-12/schema",
"type" : "object",
"properties" : {
"org.hisp.dhis.common.FileTypeValueOptions" : {
"type" : "object",
"properties" : {
"allowedContentTypes" : {
"type" : "array",
"items" : {
"type" : "string"
}
},
"maxFileSize" : {
"type" : "integer"
},
"version" : {
"type" : "integer"
}
}
}
},
"required" : [ "org.hisp.dhis.common.FileTypeValueOptions" ]
}
But in v1.1.2, I get the following error:
java.lang.IllegalArgumentException: Path not present: org
at org.jsonschema2pojo.FragmentResolver.resolve(FragmentResolver.java:54)
at org.jsonschema2pojo.FragmentResolver.resolve(FragmentResolver.java:52)
at org.jsonschema2pojo.FragmentResolver.resolve(FragmentResolver.java:52)
at org.jsonschema2pojo.FragmentResolver.resolve(FragmentResolver.java:52)
at org.jsonschema2pojo.FragmentResolver.resolve(FragmentResolver.java:31)
at org.jsonschema2pojo.SchemaStore.create(SchemaStore.java:66)
at org.jsonschema2pojo.SchemaStore.create(SchemaStore.java:140)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:78)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:41)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:70)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:38)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:121)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:66)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:83)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:79)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:41)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:70)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:38)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:121)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:66)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:83)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:76)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:79)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:41)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:70)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:38)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:121)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:66)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:83)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:76)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:79)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:41)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:70)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:38)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:121)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:66)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:83)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:76)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.ArrayRule.apply(ArrayRule.java:91)
at org.jsonschema2pojo.rules.ArrayRule.apply(ArrayRule.java:38)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:106)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:79)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:41)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:70)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:38)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:121)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:66)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:83)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:76)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.ArrayRule.apply(ArrayRule.java:91)
at org.jsonschema2pojo.rules.ArrayRule.apply(ArrayRule.java:38)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:106)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:79)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:41)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:70)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:38)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:121)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:66)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:83)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:76)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.ArrayRule.apply(ArrayRule.java:91)
at org.jsonschema2pojo.rules.ArrayRule.apply(ArrayRule.java:38)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:106)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:79)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:41)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:70)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:38)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:121)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:66)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:83)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:76)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.ArrayRule.apply(ArrayRule.java:91)
at org.jsonschema2pojo.rules.ArrayRule.apply(ArrayRule.java:38)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:106)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:79)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:41)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:70)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:38)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:121)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:66)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:83)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:76)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:79)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:41)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:70)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:38)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:121)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:66)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:83)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:76)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.ArrayRule.apply(ArrayRule.java:91)
at org.jsonschema2pojo.rules.ArrayRule.apply(ArrayRule.java:38)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:106)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:79)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:41)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:70)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:38)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:121)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:66)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:83)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:76)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.ArrayRule.apply(ArrayRule.java:91)
at org.jsonschema2pojo.rules.ArrayRule.apply(ArrayRule.java:38)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:106)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:79)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:41)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:70)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:38)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:121)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:66)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:83)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:76)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:79)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:41)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:70)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:38)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:121)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:66)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:83)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:76)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:79)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:41)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:70)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:38)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:121)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:66)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:83)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:76)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.ArrayRule.apply(ArrayRule.java:91)
at org.jsonschema2pojo.rules.ArrayRule.apply(ArrayRule.java:38)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:106)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:79)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:41)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:70)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:38)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:121)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:66)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:83)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:83)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:76)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:38)
at org.jsonschema2pojo.SchemaMapper.generate(SchemaMapper.java:92)
What value do you use for refFragmentPathDelimiters @claudemamo? I have already completed a change to hopefully fix this bug but I'd like to try with your config and example and ensure my fix will work for you too.
The default one: #/.
Closing as a duplicate of #1402.