lukaszlenart opened a new pull request, #1783:
URL: https://github.com/apache/struts/pull/1783

   Fixes [WW-4858](https://issues.apache.org/jira/browse/WW-4858)
   
   ## What & why
   
   Follow-up test coverage for the JSON parameter-filtering work in #1773. That 
PR
   tested the flat-key cases and a nested *excluded* name pattern, but left the
   nested-leaf behaviour of **accepted-name** and **include** patterns 
uncovered.
   These two paths behave differently through `JSONInterceptor`'s recursive
   tree-walk, and the difference is easy to regress silently:
   
   - **Accepted name patterns** (`AcceptedPatternsChecker`) are raw full-match
     regexes with **no hierarchy expansion**. The intermediate node (`bean`) 
must
     itself match an accepted pattern, otherwise the entire subtree is dropped
     before the leaf (`bean.stringField`) is ever visited.
   - **Include patterns** (`includeProperties`, via 
`JSONUtil.processIncludePatterns`)
     **do** expand across the hierarchy: `bean.stringField` compiles patterns 
for
     both the intermediate `bean` and the leaf, so the nested leaf populates 
while
     the excluded sibling `bean.intField` is dropped.
   
   ## Tests added (`JSONInterceptorTest`)
   
   - `testAcceptedNamePatternRejectsNestedKey`
   - `testIncludePropertiesAppliedToNestedInputWhenEnabled`
   
   Both document the intermediate-node semantics in comments so the divergence 
is
   explicit rather than surprising.
   
   ## Testing
   
   `mvn test -pl plugins/json -DskipAssembly -Dtest=JSONInterceptorTest` — 40 
tests, all pass.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to