简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM