You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having these pieces of code, tried to upgrade from Spring boot 2.X to 3.0
Controller:
@Slf4j
@RestController
public class MyController {
@RequestMapping("/cc/query/{breakdown}")
public Mono<QueryResult> getBreakdown(@PathVariable String breakdown, QueryParams queryParams) {
And the POJO container of the request parameters:
import org.joda.time.LocalDateTime;
@Data
public class QueryParams {
@NotBlank
@DateTimeFormat(pattern = "YYYYMMddHHmmss")
private LocalDateTime from;
}
This works well with Spring boot 2.7.6 but crashes with Spring boot 3.0:
DefaultHandlerExceptionResolver : Resolved [org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors<EOL>Field error in object 'queryParams' on field 'from': rejected value [20221001000000]; codes [typeMismatch.queryParams.from,typeMismatch.from,typeMismatch.org.joda.time.LocalDateTime,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [queryParams.from,from]; arguments []; default message [from]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'org.joda.time.LocalDateTime' for property 'from'; Cannot convert value of type 'java.lang.String' to required type 'org.joda.time.LocalDateTime' for property 'from': no matching editors or conversion strategy found]]
The text was updated successfully, but these errors were encountered:
Hi,
Having these pieces of code, tried to upgrade from Spring boot 2.X to 3.0
Controller:
And the POJO container of the request parameters:
This works well with Spring boot 2.7.6 but crashes with Spring boot 3.0:
The text was updated successfully, but these errors were encountered: