SrdjaNo1
SrdjaNo1

Reputation: 909

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

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?

Upvotes: 1

Views: 286

Answers (1)

Helen
Helen

Reputation: 97847

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.

Upvotes: 1

Related Questions