Duration and DataSize are commonly used data types that we could treat as scalar types in MapBinder. This would allow them to be used in keys that contain '.' without needing the [...] escape syntax.
See #27581 for an example.
Comment From: philwebb
We might want to fix #14796 first so that IDEs work.
Comment From: snicoll
If the type is annotated, that might be enough for IDEs to figure it out. That said, if we can reduce the work on their side by something a bit more explicit that we'd generate based on the presence of the annotation, that's even better.
Comment From: philwebb
The annotation is a bit of a pain for Duration. We can't add it to the type because we don't control it and adding it to all @ConfigurationProperties classes is a bit of a burden.
Comment From: wilkinsona
Perhaps the binder and annotation processor can have some hardcoded knowledge about types that are to be treated as scalars? The annotation processor can then include this information in the metadata and the IDEs can use that. If we implement #14796 in the future, it could provide an annotation that can be used to mark additional types as scalar.
Comment From: philwebb
I think that's probably our best option. I'd much prefer the metadata to tell the IDEs rather than them needing to also have that hard-coded knowledge.