Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If Type Array is empty then it is failing. #6

Open
rahulkamuni opened this issue Mar 9, 2020 · 2 comments
Open

If Type Array is empty then it is failing. #6

rahulkamuni opened this issue Mar 9, 2020 · 2 comments

Comments

@rahulkamuni
Copy link

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 ?

@simplymequeeny
Copy link
Owner

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

@rahulkamuni
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants