simplymequeeny/json-string-schema-generator

If Type Array is empty then it is failing.

Opened this issue · 2 comments

For Example if my input JSON is below :
{
"metadata": {
"properties": []
}
}
Then schema is not generating properly . we are getting below exception
"main" java.lang.NullPointerException.
Because in code we have taken directly
node = jsonNode.get(key).get(0);

Do you have any solution for this ?

hi please try adding value to 'properties' field. let me know if it is failing thanks

Thanks for your reply. For non-Empty array it is running properly . But We have huge JSON with lot of empty arrays. We are planning generated schema for empty arrays also.