ehrbase
ehrbase copied to clipboard
Wrong documentation: PUT and POST Composition return 204 in case of success, not 200
Configuration information
- EHRbase version: 0.20.0-SNAPSHOT
Steps to reproduce
- Create a new EHR
- Create composition with https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html#composition-composition-post
- Update composition with https://specifications.openehr.org/releases/ITS-REST/latest/ehr.html#composition-composition-put
Actual result
PUT: In case of success, API returns 204. POST: In case of success, API returns 204.
Expected result (Acceptance Criteria)
Docs for PUT and POST should be changed from HTTP 200 to HTTP 204.
Definition of Done
- [ ] The defect is checked by an unit or an integration test (Robot)
- [ ] Merge Request approved
- [ ] Unit tests passed
- [ ] Build without errors
- [ ] Release notes prepared
- [ ] No additional runtime warnings
Dear @flowrider3000
You are right and status code 204 No Content should definitively be listed in the responses.
However, both codes are valid and depend on the Prefer header:
- send
Prefer: return=minimalto inform the service that prefers only a minimal response to a successful request. A Location header indicating the direct URL to access the resource MUST be part of the service response. If there is no payload content to be returned, the service SHOULD use HTTP status code 204 No Content.- send
Prefer: return=representationto inform the service that prefers a full representation response to a successful request. A Location header indicating the direct URL to access the resource MAY be part of the service response, and the payload content SHOULD include a full representation.
https://specifications.openehr.org/releases/ITS-REST/latest/overview.html#design-considerations-representation-details-negotiation
I closed it by mistake (clicking on the wrong button). I let you close the issue if I answered your question.
Hi @subigre
Thanks for the link to the Prefer header.
Should we keep this issue open until 204 is added to the documentation? If not, the issue can be closed.
Hello @flowrider3000, Bug reported in JIRA https://jira.vitagroup.ag/browse/CDR-460 for tracking purposes. Will let you know in case of any updates.