Replies: 1 comment 2 replies
-
Specifically in the proposed PR (not moved to discussion), when using Execution Context that is passed to an endpoint like:
If resource 1 does not exist in that execution context, what should the proper status code be? Does it behave as if the resources does not exist and return a 404. This implies that IDs for the resource are unique only within an execution context, and that the URL is NOT a direct locator or unique address - which I think is problematic for general RESTful API Design. Alternatively, you could return a 400, which implies the user made a bad request - that resource exists but not in that context. Of course an error message would provide that feedback I imagine. If I understand correctly the advantage of some endpoints requiring an execution context is to enforce validation, that you don't accidently retrieve a resource from the wrong context and mixup "production" requests from "sandbox" requests? The core statement from the PR to discuss:
This pattern as a requirement is pushing it towards a composite key. |
Beta Was this translation helpful? Give feedback.
-
In what cases do we need to return 400 or 404 status in responses, for example when ID is correct, but Execution Context header is not (i.e. service has resource with this id, but not for given context)?
Links to #92
Beta Was this translation helpful? Give feedback.
All reactions