Fix the format_errors bug when response data is None#1229
Open
ericinfins wants to merge 3 commits intodjango-json-api:mainfrom
Open
Fix the format_errors bug when response data is None#1229ericinfins wants to merge 3 commits intodjango-json-api:mainfrom
ericinfins wants to merge 3 commits intodjango-json-api:mainfrom
Conversation
Member
|
Thanks for following up on this. I will take a look at it at some point and will give you feedback. Just writing to let you know that I saw it. |
Member
|
I have finally got around to take a look at this. Great to see how this can be reproduced by using vanilla DRF classes. It is though as I expected that this fix does avoid the exception, however the output of the fix is not JSON:API compliant. It simply returns {
"errors": None
}but the value of errors needs to be a list and each error object must at least have one member. I think the easiest is to add a single error object with the status code as a string. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #
Related to the PR: #1121
Add the test case to support it
Description of the Change
Fix: TypeError: object of type 'NoneType' has no len()
Checklist
CHANGELOG.mdupdated (only for user relevant changes)AUTHORS