Documentation about customizing responses when mocking


(Sebastien Arbogast) #1

After modelling my entire API with Stoplight Next’s interface, I went through the entire Mocking documentation there (https://docs.stoplight.io/mocking) and I managed to get my API mocked and served by Prism both from Stoplight and locally, but using static mocking. Now I would like to customize the responses of my API and use dynamic mocking instead, but the documentation stops there and points me to a huge test project with a lot of scenarios and mocks that is pretty hard to navigate.

For example, one of my endpoints lets me POST a new entity with its data, and I would like the endpoint to respond with the same entity from the request, with a generated UUID as an ID. And I can’t figure out how to do that.

Is there other documentation about how to use dynamic mocking with Prism and Stoplight Next somewhere?


(Thomas De Groof) #2

Following.
We are very interested in extending the mocking server’s capabilities as well, but I’m hugely confused how to…

I’ve started with copying the “helpers.scenarios” file mentioned in the documentation to our own project, but the mock server doesn’t even start (errors!) when using before & after rules from the project file instead of the common rules.

A basic tutorial (e.g. dynamically updating response examples) with how to customize mocking feature would be an enormous help.


(Taylor Barnett) #3

@sebastien.arbogast this is great feedback! Let me see if I have anything to share right now.

We are also doing a lot of work on getting a major version of Prism out. It’s very much new and improved. This is definitely something I want for the new docs for it.