networknt / json-schema-validator

A fast Java JSON schema validator that supports draft V4, V6, V7, V2019-09 and V2020-12
Apache License 2.0
822 stars 323 forks source link

Handle Jackson Databind's 'MissingNode' null object better #976

Closed adityachatterjee42 closed 3 months ago

adityachatterjee42 commented 6 months ago

Jackson Databind uses com.fasterxml.jackson.databind.node.MissingNode as a 'null object'

Supplying the MissingNode singleton to JsonSchema.validate(...) leads to the following validation error message: $: unknown found, {} expected

I suggest we explicitly handle MissingNode and return a more descriptive error message, or fail in a different way.

justin-tay commented 6 months ago

Can you provide the example and input data used? Are you sure it is MissingNode and not NullNode? I don't really see any issue with the message.

stevehu commented 3 months ago

Closing the issue as there is no action.