json-string-schema-generator icon indicating copy to clipboard operation
json-string-schema-generator copied to clipboard

If Type Array is empty then it is failing.

Open rahulkamuni opened this issue 5 years ago • 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 ?

rahulkamuni avatar Mar 09 '20 13:03 rahulkamuni

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

simplymequeeny avatar Mar 09 '20 13:03 simplymequeeny

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.

rahulkamuni avatar Mar 09 '20 14:03 rahulkamuni