jcustenborder / kafka-connect-json-schema

Apache License 2.0
14 stars 14 forks source link

how to handle nested json array #16

Open samyujialiu opened 2 years ago

samyujialiu commented 2 years ago

Hi there: We are trying to use the json body to match the given schema. But it failed when it handle the nested Json array. Does it possible to handle the case? Thanks a lot The Json body: { "id": "0001", "batters": { "batter": [ { "id": "1001", "type": "Regular" }, { "id": "1002", "type": "Chocolate"} ] } } The json schema: { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "batters": { "type": "object", "properties": { "batter": { "type": "array", "items": [ { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" } }, "required": [ "id", "type" ] } ] } }, "required": [ "batter" ] } }, "required": [ "id", "batters" ] }