Skip to content

Conversation

@HT154
Copy link
Contributor

@HT154 HT154 commented Nov 25, 2025

This has been banging around in my head for a while and I finally needed to get it out.

This PR adds a new property BaseValueRenderer#annotationConverters that enables defining converters that act on both the property name and value of annotated properties of Typed values.

This enables defining declarative key and/or value transformations in cases where neither Class- nor path-based converters can be applied gracefully. It is also the only way to express transforming the resulting property names in Typed objects without applying a converter to the entire containing type, which is cumbersome at best.

This PR originally overloaded BaseValueRenderer#converters for this purpose. This implementation has been preserved in the first commit in the PR if you wish to compare that to implementation with the new property. A limitation of the previous design is that you can't have both a class and annotation converter for the same Annotation subclass (though this is probably unlikely to be an issue in practice).

This is not final; it probably needs further discussion and a SPICE.

This also fixes a silly wart in the API for getting class property mirrors.

Resolves #576

@HT154 HT154 force-pushed the annotation-converters branch from f34bd77 to 1870188 Compare November 29, 2025 20:40
@HT154 HT154 force-pushed the annotation-converters branch from 1870188 to 274ba33 Compare November 29, 2025 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Output converters should allow selection for properties by Annotation

1 participant