Search code examples
automated-testspostmanjsonschema

Reference JSON schema from "define" API YAML file in Postman instead of creating a variable with actual JSON


I have an API in Postman that has defined JSON schemas for every request\response. I also have a collection of tests that I use for testing this API, but I don't know how to connect these two substances (things) I have been searching for a solution for quite a while now and havent found an example set-up or a tutorial how? instead of creating a variable with actual schema in my test collection, I want to reuse already existing schema from API by $ref or some other link method.

This is my first question here, writing it just because I haven't found a proper answer but functionality that I seek sounds really basic and logical.


Solution

  • Update from Valentin Despa:

    "Please note that the API definition is written in a specification like Open API (or similar). It is not the same as the JSON schema which refers to the response body only."

    So we can't validate response using that schema.