Validate the response body using an external JSON Schema file.
Both JSON and YAML files are supported.
NOTE: All $refs are dynamically de-referenced automatically, both locally and remotely.
Use an external file from the root-level schema.
1link - name: get users
2link request:
3link path: /users
4link method: get
5link response:
6link json_schema:
7link type: file
8link $ref: static/schemas/users.json # path to the expected schema file
Validate against some sub-property within a schema file by using a JSON Pointer in the $ref
💡 HINT: this is very useful if you already have an Open API / Swagger spec since
1link - name: get users
2link request:
3link path: /users
4link method: get
5link response:
6link json_schema:
7link type: file
8link # uses property $.components.schemas.users
9link # within file 'static/schemas/open-api.json'
10link $ref: 'static/schemas/open-api.yml#/components/schemas/users'
💡 NOTE: paths containing a forward slash can be URL-encoded as %2F
See also: