1

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?

Helen
  • 87,344
  • 17
  • 243
  • 314
SrdjaNo1
  • 755
  • 3
  • 8
  • 18
  • Related: [SwaggerHub mock response returns 201 despite missing fields in POST request](https://stackoverflow.com/q/50569368/113116) – Helen Jun 03 '21 at 07:28

1 Answers1

1

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.

Helen
  • 87,344
  • 17
  • 243
  • 314