SwaggerHub mock always returns the same id - is this expected?

196 Views Asked by At

I created a very simple OpenAPI docs as I have just started learning about it.

This is the link: https://app.swaggerhub.com/apis-docs/srki.coric/Shopping_Cart/1.0.0

There is a mock server however, my expectation was that if I do a POST request with certain data, that the response will contain that data, and that _id would be auto-generated, but the response is always the default one.

Is this the expected behavior or I am doing something wrong?

1

There are 1 best solutions below

0
On

This is expected behavior. SwaggerHub mocks are static, not dynamic. The mock does not process input data in any way, it just returns a static response based on the response schema. See How response mocking works in SwaggerHub documentation.