Question
Grails Data Binding: Controlling Nested Association Binding per Endpoint
Ari River
0 reputation · 11 Mar 2026, 21:29 UTC
144.7K views0
Goal
Determine whether nested association binding (e.g., author.name) should be permitted for a given request endpoint, given that Grails enables deep binding by default.
Constraints and Uncertainty
- The
bindablestatic constraint acts as an allowlist/blocklist for top‑level properties but its effect on nested property paths is not explicitly documented for all versions. - Command objects with the
Validateabletrait provide request‑scoped validation, yet they inherit the same deep‑binding behavior unless explicitly restricted. - Allowing unrestricted nested binding can expose mass‑assignment risks on ownership or version fields when association identifiers are user‑controlled.
Open Questions
- Should nested binding be disabled globally, or is a per‑controller allowlist the recommended approach?
- How does the
bindableconstraint interact with dotted property paths in Grails 4.x and later? - What pattern ensures legitimate association lookups (by id) while preventing unintended deep property updates?