Feature #119
openAPI - don't return 200 when attempting to modify unchangeable attributes
0%
Description
If you try to hit an update endpoint like this:
{{protocol}}://{{host}}:{{port}}/api/tasks/{{task_id}}
With a body that includes an updated attribute which you can't change, like "completed",
you'll get a 200 response including with a body indicating that the API updated what it could but the protected field won't be changed.
Instead, you should get a different http code and you should be notified that the request was malformed.
Updated by Sam Pearson 3 months ago ยท Edited
It may be useful to decide whether idempotency is something we want and/or if "idempotent consistency" is worth chasing.
sometimes idempotency feels bad and wrong, like when you try to connect things that are already connected or disconnect things that are already disconnected
it smells bad. You're getting feedback that you've arrived at the state you wanted, but the path you took there may have been a circle. It feels like smashing ctrl+c fifteen times to make sure it actually copied.
But like many engineering decisions, consistency is probably more important than making the right call.
Updated by Sam Pearson 23 days ago
- App Component set to API
More of a design issue, it's unclear what to do when the user tries to execute an update request with some valid and some invalid attributes.