I still evaluating Stoplight for my company as part of the assessment.
I think it’s clear to me how to mock, and create authentication, but I still struggled (sorry if I’m asking something quite obvious) on mocking behaviours. We’re implemeting an extremely easy business case of an API which returns code country from a country name and a country name from a code.
These are a few scenarios I’d like to write using Stoplight:
Scenario Outline: Getting a Country Name from a Country Code
Given a Country Code “CountryCode”
When I request Country Name
Then the result should be “CountryName”
| CountryName | CountryCode |
| India | IN |
| Spain | ES |
| United States | US |
I’ve been able, by configuring examples, to return following model:
However, in order to model such scenarios, I would need, to send a code “US” and return “United States”.
I’ve gone through the documentation, but I’m a little confuse about this point. Could you suggest me a point to start modelling behaviours?
FYI, I’m working behind a corporate proxy, so I cannot use local prism (unless cheating IT Security policies with ngrok or something like that).