We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, I'm writing tests for API validation, and TV4 is very useful for this, but I can't find out how to check this JSon structure : JSON SOURCE:
{ "count":5, "version":"1.0", "19":{ "prestationId":6225, "luluId":32, "craftsmanId":null, "status":"accepted" }, "20":{ "prestationId":6225, "luluId":64, "craftsmanId":null, "status":"inactive" }, }
TV4 implementation
var schema = { "type": "object", "required": [], "properties": { "prestationId": { "type": "integer" }, "luluId": { "type": "integer" }, "craftsmanId": { "type": ["integer", "null"] }, "status": { "type": { "enum" : [ 'pending', 'accepted', 'refused', 'deleted', 'inactive'] } }, }, "additionalProperties": false }; var data = JSON.parse(responseBody); var result = tv4.validateResult(data, schema);
I just want to watch & validate sub-arrays, not the main one. I've try with $refs but it seems don't work with me.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello, I'm writing tests for API validation, and TV4 is very useful for this, but I can't find out how to check this JSon structure :
JSON SOURCE:
TV4 implementation
I just want to watch & validate sub-arrays, not the main one. I've try with $refs but it seems don't work with me.
The text was updated successfully, but these errors were encountered: