Ask a Question

Assertions: Json Schema complaince

SOLVED
patilawaken
Occasional Contributor

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.
3 REPLIES 3
avidCoder
Super Contributor

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.

TanyaYatskovska
SmartBear Alumni (Retired)

Thanks for the suggestion, @avidCoder!

 

@patilawaken, is this what you are looking for?

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



patilawaken
Occasional Contributor

 Thanks

cancel
Showing results for 
Search instead for 
Did you mean: