jsonschema - Dredd (gavel) : Begin a Json Schema with an array (bug ?) -
i using markdown generate documentation (aglio), generate mocks (api-mock) , check integrity constraints (dredd).
with dredd, no problem check object, no problem put or post, have problem lists.
my lists arrays, when write schema :
{ "title": "videos list", "type": "array", "items": { "type":"object", "required":false, "properties": { "id": { "type": "string", "required": true } }, "required": true } }
i same error time: body: json schema not valid! invalid type: object (expected [object object]/array) @ path "/items"
i've tried, again , again, 3 hours, failed.
please help!
ps : sorry english, i'm french.
yes, data correct again schema.
it might specific problem of validator using (you did not mention which). can try enclose data {}. guess expecting allways json this:
{ [ { "id": "ninon-retrouve-rudy", "title": "ninon retrouve rudy edited" }, { "id": "ninon-retrouve-rudy-1", "title": "ninon retrouve rudy" } ] }
be aware using draft03 of json-schema. suggest use draft04 (your validator might obsolete).
Comments
Post a Comment