I have something of a simple usecase: User has a set of Privileges; when I create the User resource I do not want to also create Privileges; so, if a new User with new Privileges comes from the client, I want to respond with something along the lines of:
I cannot create the User Resource because the Privileges it contains do not exist.
At this point, the client can do a Create on the Privilege first and then add them to the User and create that.
The question is what Error status code to use for the HTTP response:
- 412 - Precondition Failed
- 424 - Failed Dependency
I also considered (but do not seem to fit the usecase):
- 400 - Bad Request
- 422 - Unprocessable Entity