Assertions: Json Schema complaince
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Assertions: Json Schema complaince
I want to use the Json schema complaince assertion in Ready API for API response schema validation.
While adding assetion, Its required to add the Schema URL,
- What is this URL?
- What does this URL consists of?
- I dont have any schema URL, I have only json schema stored in a file.
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This url can be any normal url link which contains JSON schemas.
For example - http://example.com/docs/path/employee.json
Which contains the schemas like this:-
{ "$id": "https://example.com/person.schema.json", "$schema": "http://json-schema.org/draft-07/schema#", "title": "Person", "type": "object", "properties": { "firstName": { "type": "string", "description": "The person's first name." }, "lastName": { "type": "string", "description": "The person's last name." }, "age": { "description": "Age in years which must be equal to or greater than zero.", "type": "integer", "minimum": 0 } } }
So, in your case, I guess, you cannot use this JSON Schema complaince. Since, you don't have the urls.
You can use JSON Path Assertions.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the suggestion, @avidCoder!
@patilawaken, is this what you are looking for?
Tanya Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks avidCoder,
Can we use any third party library for jason schema validation and the assertion is script assertion.
Does Ready API supports any jsson schema validator like tv4, ajv etc.?
