fiware-orion
fiware-orion copied to clipboard
Partial success HTTP status codes
for certain entity update operations, for instance, append attributes in strict mode, if one or more of the concerned attributes already exist, the operation will end up with a 422 error code, but any non-existent attribute will have been added to the entity. i.e something went well, something went bad ...
Status code 422
could be changed by another HTTP status code that gives information to the client that the operation had a partial success, i.e. something went well but not all
see
https://stackoverflow.com/questions/8472935/http-status-code-for-a-partial-successful-request
Hi @jmcanterafonseca & @fgalan Sir I would like to work on this issue. Please assign this issue to me if it still needs to be fixed.
@rajeswar-NEC thank you for your willingness to work in this issue! You have been assigned.
However, before modifying the code to solve it, we should decide which HTTP code should be used instead of 422. I have had a look to the reference https://stackoverflow.com/questions/8472935/http-status-code-for-a-partial-successful-request but it's not clear to me which one should be used.
Hi @fgalan sir, Due to medical reason @rajeswar-NEC is not able to work on this issue. I will work on this issue in future and will try to analyzing this issue.
Hi @fgalan Sir,
However, before modifying the code to solve it, we should decide which HTTP code should be used instead of 422. I have had a look to the reference https://stackoverflow.com/questions/8472935/http-status-code-for-a-partial-successful-request but it's not clear to me which one should be used.
Please confirm which HTTP code should be used instead of 422. So that I will try to fix this issue
Please confirm which HTTP code should be used instead of 422.
Do you have any proposal for the new code to be used?
Do you have any proposal for the new code to be used?
As per my understanding we should use HTTP 207 Multi-Status code. https://stackoverflow.com/questions/30571489/what-are-applicable-scenarios-in-using-http-status-207-in-rest-api
Not sure if 207 is the proper one...
As far as I have checked, 207 belongs to the WebDAV extension to HTTP and involves a specific response payload in XML, described at https://datatracker.ietf.org/doc/html/rfc4918#section-13
The default Multi-Status response body is a text/xml or application/xml HTTP entity with a 'multistatus' root element
That's not compatible with the responses generated by Orion.
Anyway, if choosing the right HTTP code is taking time and blocking this issue, maybe what we can do is to use a #define
directive to pick someone now (for instance, that 207) and later to adjust to the definitive one.
Anyway, if choosing the right HTTP code is taking time and blocking this issue, maybe what we can do is to use a
#define
directive to pick someone now (for instance, that 207) and later to adjust to the definitive one.
I have fixed this issue by picking HTTP code 207 and raise PR for the same. Please review my PR #4003 if it is Ok then please merge it into master
@fgalan Gentle reminder !!
Hi @fgalan, I'm working on it, and soon I will upload a diff.
This issue is going to be closed. Rationale here: https://github.com/telefonicaid/fiware-orion/pull/4266#issuecomment-1425992547