lukaszlenart opened a new pull request, #308:
URL: https://github.com/apache/struts-site/pull/308
## Summary
Clarifies how the `@StrutsParameter` `depth` parameter is counted and fixes
an incorrect example, based on feedback from Markus (flyingfischer.ch) on the
user list after the 7.2.1 announcement.
He hit a hard-to-diagnose case adopting the WW-5626 breaking change:
populating a `List<MyObject>` property was rejected with `depth = 1` and
required `depth = 2`, even though the element was a flat POJO. The docs
previously showed `depth = 1` for exactly this collection scenario.
## Changes
- **New section "Understanding the `depth` parameter"** with a worked table,
explaining that each property access **or** collection/map index counts as one
level — so reaching an element's property costs one more level than the same
property on a plain object. Includes the correct default (`depth = 0`) and the
canonical rule from the annotation ("number of periods or brackets in the
parameter name"), verified against `StrutsParameter.java`.
- **Fixed the collection example** — `getUsers()` now uses `depth = 2` (was
`depth = 1`), with a note that this holds even for flat element types.
- **Added a JSON/REST note**: a body like `{"users":[{"name":"John"}]}`
populates `users[0].name`, so the getter must be annotated with `depth = 2`;
annotating only the setter is not enough.
## Context
- JIRA: [WW-5626](https://issues.apache.org/jira/browse/WW-5626)
- Reported on the `[email protected]` list in the `[ANN] Apache Struts
7.2.1` thread.
🤖 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]