Skip to content

Commit 61711a6

Browse files
[9.x] Clarify etc behavior on nested attributes (laravel#8185)
* Update http-tests.md * Update http-tests.md Co-authored-by: Taylor Otwell <[email protected]>
1 parent 82fda2b commit 61711a6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

http-tests.md

+2
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,8 @@ In the example above, you may have noticed we invoked the `etc` method at the en
376376

377377
The intention behind this behavior is to protect you from unintentionally exposing sensitive information in your JSON responses by forcing you to either explicitly make an assertion against the attribute or explicitly allow additional attributes via the `etc` method.
378378

379+
However, you should be aware that not including the `etc` method in your assertion chain does not ensure that additional attributes are not being added to arrays that are nested within your JSON object. The `etc` method only ensures that no additional attributes exist at the nesting level in which the `etc` method is invoked.
380+
379381
<a name="asserting-json-attribute-presence-and-absence"></a>
380382
#### Asserting Attribute Presence / Absence
381383

0 commit comments

Comments
 (0)