Tricky one, this. All Open API swaggers are generated, and the tooling "decides" which return codes to generate. In v4 we don't have much control over that, in v5 the situation is a lot better.
For a task resource like this one (product recommendation), we can imagine valid use cases:
- 200 - recommendation is returned synchronously, no persistence
- 201 - recommendation is returned synchronously or asynchronously, and is persisted for future retrieval
- 202 - recommendation is returned asynchronously (hence the Accepted code).
It's up to you as an API implementor to decide which pattern(s) to support for your task resources.
------------------------------
Jonathan Goldberg
Amdocs Management Limited
Any opinions and statements made by me on this forum are purely personal, and do not necessarily reflect the position of the TM Forum or my employer.
------------------------------