https://github.com/spring-projects/spring-framework/blob/e565d2cabb01539933195b0d1bc3b55992fb9c84/spring-beans/src/main/java/org/springframework/beans/TypeConverterDelegate.java#L133

I defined a UUID converter file implementing Converter interface. And it works expected, for a particular use case I am able to throw an exception. However internally this exception is by passed in the selected code and implicit conversion is applied which is incorrect.

Comment From: sbrannen

Please provide a minimal example demonstrating the behavior you are describing (preferably as a Git repo or ZIP file -- something we can download and run that demonstrates the issue).

Comment From: joshibhu

please find attached POC. 1. In this I have declared an explicit converter. Which validates the input UUID and if it fails throws an exception. 2. There is an API call - /v1/employee/{id} 3. Passing 1-1-1-1-1 as {id} above 4. The exception is being thrown from the explicit converter (StringToUUIDConverter) however there after spring also attempts to covert this string into UUID and result into "00000001-0001-0001-0001-000000000001" in api response

API - http://localhost:9000/v1/employee/1-1-1-1-1 O/P - Hello from Service A, Employee ::00000001-0001-0001-0001-000000000001 serviceA-example 2.zip

Comment From: snicoll

Thanks for the sample. This looks like the intended behavior: when the conversion failed, a fallback on property editor is done and we use that instead, see https://github.com/spring-projects/spring-framework/blob/9e144afc0df891d72fc76f364586ed4d409ad842/spring-beans/src/main/java/org/springframework/beans/TypeConverterDelegate.java#L277-L283

@jhoeller I wonder if there's a recommendation here as UUIDEditor is configured by default.

Comment From: snicoll

Double checking with Juergen, I confirm the current behavior is expected given the registration by default.