Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[6.x] Implement ArrayAccess on JsonResponse + TestResponse#30817

Merged
taylorotwell merged 9 commits into
6.xfrom
array-access-response
Dec 11, 2019
Merged

[6.x] Implement ArrayAccess on JsonResponse + TestResponse#30817
taylorotwell merged 9 commits into
6.xfrom
array-access-response

Conversation

@taylorotwell

@taylorotwell taylorotwell commented Dec 11, 2019

Copy link
Copy Markdown
Member

When building / testing and JSON API, I like to sometimes interact with the raw JSON payload returned in the response. Normally you would have to access this via $response->original['foo']; however, with this change I implement ArrayAccess on both JsonResponse and TestResponse in order to be able to proxy directly into the response JSON without going through the original property.

image

@taylorotwell taylorotwell merged commit f5c3c60 into 6.x Dec 11, 2019
@taylorotwell taylorotwell deleted the array-access-response branch December 11, 2019 20:27
@GrahamCampbell GrahamCampbell changed the title Implement ArrayAccess on JsonResponse + TestResponse [6.x] Implement ArrayAccess on JsonResponse + TestResponse Dec 11, 2019
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.

1 participant