When ConfigurationPropertySourcesPropertyResolver resolves a property, it calls AbstractPropertyResolver.convertValueIfNecessary() which uses a ConversionService to produce the target type. This allows types such as com.google.protobuf.ByteString to invoke a custom method such as toStringUtf8 rather than toString to produce its String representation.

When ConfigDataEnvironmentContributorPlaceholdersResolver resolves a property, it calls String.valueOf() - bypassing any registered converter.

Original issue describing specific use case: https://github.com/GoogleCloudPlatform/spring-cloud-gcp/issues/2690

Affects Spring Boot 2.4.x - 3.2.x.

Comment From: philwebb

We think this is a bug, however, we've had lots of issues in the past with the conversion service causing unexpected problems when we change things. We're specifically worried that someone might get an unwanted conversion.

We're going to try and fix this in 3.3 and see if it causes any problems for folks that upgrade. If it doesn't we can consider backporting the fix later.