zoubingwu / msw-auto-mock

A cli tool to generate random mock data from OpenAPI definition for msw.
273 stars 57 forks source link

Parameterize Responses for Mocked Post Requests #45

Open tylerpashigian opened 9 months ago

tylerpashigian commented 9 months ago

I am integrating with an API that relies on the response of a POST request (updating an item) that returns the updated model and our front end updates our local state from that response. In order to run integration tests, I would like to confirm that the value we pass into the endpoint is returned from the mock (or at least certain values).

Is there a configuration we can set (or a change to Swagger we can make) to ensure our desired fields are returned as the req data rather than faker fields?