Skip to content

Enforce conflict response when requested PATCH resource object is unequal to endpoint #763

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

Merged
merged 11 commits into from
Jan 23, 2020

Conversation

bpleshakov
Copy link
Contributor

@bpleshakov bpleshakov commented Jan 16, 2020

Description of the Change

A server MUST return 409 Conflict when processing a PATCH request in which the resource object’s type and id do not match the server’s endpoint.

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test added
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name in AUTHORS

Boris Pleshakov added 3 commits January 16, 2020 19:27
A server MUST return 409 Conflict when processing a PATCH request in which the resource object’s type and id do not match the server’s endpoint.
@codecov
Copy link

codecov bot commented Jan 17, 2020

Codecov Report

Merging #763 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #763   +/-   ##
=======================================
  Coverage   97.12%   97.12%           
=======================================
  Files          54       54           
  Lines        2787     2787           
=======================================
  Hits         2707     2707           
  Misses         80       80

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c51f6b9...7977c00. Read the comment docs.

@sliverc sliverc changed the title Validate that body and url id match. Enforce conflict response when requested PATCH resource object is unequal to endpoint Jan 20, 2020
Copy link
Member

@sliverc sliverc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this great addition to DJA. I always like to see PRs making DJA follow the JSON API spec more closely.

I have added some comments. Additionally in the body I have also added the pull request template again with the checklist. Could you add yourself to AUTHORS list as well and add a changelog entry?

Thanks.

@bpleshakov bpleshakov requested a review from sliverc January 20, 2020 18:17
Copy link
Member

@sliverc sliverc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@sliverc sliverc merged commit 96aaa13 into django-json-api:master Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants