question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Complex JSON Schema Validation Fail

See original GitHub issue

Hello,

I have observed JSONSchema validation for complex object when object is inside an Array is not working as expected. Validation of objects inside arrays are ignored by validation library.

I used attached JSON schema and register them in APICurio. On validating below data, validation is successful which is supposed to fail as zipCode is string and expected to be integer.

{
    "firstName":"568dfa8d-2cd9-473e-acb5-9be84382a74b",
    "lastName":"6635e20a-7be7-4b96-a5bc-c13fa57a4a04",
    "age":20,
    "city":[{"name":"573f459c-0aa4-4338-9821-60a04260cc7e","zipCode":"12345"}]
}

citizen.zip

I sent the below data

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
EricWittmanncommented, Jul 7, 2022

Can you explain the use-case further? Are you using Apicurio SerDes with JSON Schema validation enabled in a Kafka application? How are you validating the message/data using the schema registered in registry?

0reactions
carlesarnalcommented, Oct 14, 2022

Closing as it was confirmed in https://github.com/Apicurio/apicurio-registry/pull/2854 that the fix is working as expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to validate the json against a complex json schema ...
When I give data as follows I am expecting error that cropLocation doesnt have state and country prperty. but it validates as success...
Read more >
A Vocabulary for Structural Validation of JSON - JSON Schema
JSON Schema validation asserts constraints on the structure of instance data. ... possible instance values of the correct type that will fail validation.¶....
Read more >
JSON Schema validation fails or hangs against large ... - GitHub
When i try to validate json object against large JSON Schema, it fails or rather keep on processing for unlimited time.
Read more >
Validate Complex JSON Schema With References in Postman
With this jsonSchema tool, I can turn my data into a JSON Schema. It's naive to think that this is all I need...
Read more >
JSON validation - IBM
A validation error occurs when the JSON document does not conform to the rules that are defined in the JSON schema. The JSON...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found