Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

409 Conflict Status Code #40

Open
YoucTagh opened this issue Jun 26, 2023 · 2 comments
Open

409 Conflict Status Code #40

YoucTagh opened this issue Jun 26, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@YoucTagh
Copy link

409 Conflict could be used in case of error when processing a PUT HTTP method.

@RubenVerborgh RubenVerborgh added the enhancement New feature or request label Jun 26, 2023
@larsgsvensson
Copy link
Member

To me 422 seems the better choice.
According to RFC 9110 409 Conflict is about conflict of due to the state of the representation (as in version control systems). 422 Unprocessable Content gives the example of "media type is correct and content syntactically OK, but the semantics of the supplied resource are incorrect" which I think is what we intend.

@YoucTagh
Copy link
Author

YoucTagh commented Aug 2, 2023

I agree with you. The 422 Unprocessable Content status code seems more appropriate in our case.

I was able to find two other RFCs that refer to this status code: RFC 4918 and RFC 5789. An example of how to use the status code can be found at this link.

The body of the response can be used to indicate the reason for the error and possibly how to fix it. In the case of non-conformance to a SHACL shape graph, I think the validation report can be a good hint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants