borinquenkid commented on PR #16033: URL: https://github.com/apache/grails-core/pull/16033#issuecomment-5350325563
Thanks for pushing on this — the mapping-context finding is a good catch, and I agree it changes what this PR should claim. **On the premise.** You're right that `mappingContext` being a plain (non-`@Shared`) trait property means every feature already gets its own `KeyValueMappingContext`, with or without this PR. I've updated the description to stop framing this as a flakiness fix and call it what it actually is: closing a real same-package-borrowing footgun, independent of whether it explains #16030. The whole-spec-fixture-failure theory is still the leading explanation for that issue and remains open. **On the design question — done, in `d7ee26c4b2`.** Switched from prefixed class names to per-spec sub-packages, each keeping the original simple names: - `grails.plugin.json.view.expand`, `.include`, `.halembedded`, `.iterable`, `.maprender`, `.nullrendering` for `Team`/`Player`/`PlayerWithAge`/`Person`/`Address` - `grails.plugin.json.view.api.handleassociations` for `Author` Since `type`/`href` values come from the entity's simple class name, none of the expected-JSON assertions had to change — the diff on the 8 touched spec files dropped from +363/−219 to +100/−99, plus 7 small new fixture files. And it's self-enforcing the way you described: a same-package unqualified reference can't resolve into another spec's fixture anymore, because they're in different packages. **Both remaining gaps from your last pass are closed:** - `HalEmbeddedSpec`'s `Address` now has its own copy alongside `Person`. - `NullRenderingSpec` gets its own `Child` POGO instead of unqualified-borrowing `PogoDeepRenderingSpec`'s `Child2`. **`TemplateInheritanceSpec` and `PaginationSpec` are intentionally left alone**, per your reasoning: the published `child2`/`child4`/`circular` `.gson` templates import `grails.plugin.json.view.Player`/`.Circular` directly, so `TemplateInheritanceSpec`'s model has to be that exact class — I added a comment on the class explaining that so it doesn't read as an oversight next time. `PaginationSpec`'s explicit `import grails.plugin.json.view.Book` is disambiguating, not silently binding, so per your comment I left it as-is. Also fixed the `captain.id == 1L` no-op you flagged — deleted rather than turned into an assignment, since the expected HAL link asserts no id. Verified: full `:grails-views-gson:test` (178 tests) 0 failures, `codeStyle` clean. -- 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]
