How to validate a nested JSON array of objects in Karate DSL when the array can be empty using an external .json schema file?
I am trying to do a JSON schema validation in Karate DSL of an API response that returns an array of objects. Each object contains required string fields (id, description) and a nested statuses array. The statuses array is always present in the response object but it can be empty ([]) for some records. When statuses is not empty, every object inside it must strictly contain required string fields id and name. This is a sample of the response: [ { "id": "A101", "description": "Record with statuses", "statuses": [ { "id": "S1", "name": "APPROVED" } ] }, { "id": "B102", "description": "Record wit
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.