nzStacy
3 years agoOccasional Contributor
Schema validation for offline schemas
Hi, in Postman I can define a schema and the assert against that directly - how can I do this in Ready API
eg, the schema and then the assert
I see ready API has a URL to point to but I can't use it, so was wondering how I do this the same as postman
const schema = {
"type":"array",
"items":[
{"type":"object",
"properties":{
"Id": {"type":"string"},
"Number": {"type":"string"},
"AK": {"type":"integer"},
"CategoryId": {"type":"integer"},
"Note": {"type":"string"},
"CreatedByUserId": {"type":"string"},
"CreatedDate": {"type":"string"},
"LastModifiedByUserId": {"type":"string"},
"LastModifiedDate": {"type":"string"}
},
"required":["Id", "Number", "AK", "CategoryId", "Note", "CreatedByUserId", "CreatedDate", "LastModifiedByUserId", "LastModifiedDate"],
"additionalProperties": false}], }
pm.response.to.have.jsonSchema(schema);
Thanks