Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Avoid printing invalid pointer when api returns 404 #599

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
sliverc merged 4 commits into django-json-api:master from amw:fix-pointer-for-404
Aug 9, 2019

Conversation

amw
Copy link
Contributor

@amw amw commented Mar 18, 2019

Fixes the pointer for 404 results.

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

Copy link

codecov bot commented Mar 18, 2019
edited
Loading

Codecov Report

Merging #599 into master will decrease coverage by 0.13%.
The diff coverage is 100%.

Impacted file tree graph

@@ Coverage Diff @@
## master #599 +/- ##
==========================================
- Coverage 96.11% 95.98% -0.14% 
==========================================
 Files 56 56 
 Lines 2859 2866 +7 
==========================================
+ Hits 2748 2751 +3 
- Misses 111 115 +4
Impacted Files Coverage Δ
example/tests/test_model_viewsets.py 100% <100%> (ø) ⬆️
example/tests/integration/test_polymorphism.py 96.74% <0%> (-3.26%) ⬇️

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 b1acaf1...dbe02e4. Read the comment docs.

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 for your contribution and well spotted, the pointer is invalid indeed.

The specification doesn't specifically clarify what to do in case of a 404 error. In this discussion though they suggest not to add a pointer in case of 404. Sounds kind of logical to me as there is not data actually returned so they can't be a pointer.

Could you adjust your PR so it doesn't add a pointer in case of 404?

@amw amw force-pushed the fix-pointer-for-404 branch from 3f804c9 to 7464deb Compare August 6, 2019 10:42
Copy link
Contributor Author

amw commented Aug 6, 2019

I've removed the source entirely for 404 errors.

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.

@sliverc sliverc changed the title (削除) Fix pointer used by Http404 exception (削除ここまで) (追記) Avoid printing invalid pointer when api returns 404 (追記ここまで) Aug 9, 2019
@sliverc sliverc merged commit 7efd877 into django-json-api:master Aug 9, 2019
@amw amw deleted the fix-pointer-for-404 branch January 24, 2021 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@sliverc sliverc sliverc approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /