在sb 2上转换ZonedDateTime参数失败

时间:2018-06-21 07:41:15

标签: spring-boot spring-restcontroller spring-hateoas

从1.5.9.RELEASE升级到sb 2.0.3时,似乎对包含ZonedDateTime参数的资源链接进行了编码回归。 例如:

http://host/api/resource/search/findXYZ?timeStart=2018-06-20T07:28:06.951%2B02:00%5BEurope/Copenhagen%5D

提供

http://host/api/resource/search/findXYZ?timeStart=2018-06-16T08:49:47.622+02:00%5BEurope/Paris%5D

但是在2.0.3上,区域偏移量+符号未编码

Failed to bind request element: org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.time.ZonedDateTime'; nested exception is org.springframework.core.convert.ConversionFailedException

这导致

public ResponseEntity<Foo> findXYZ(@RequestParam(value = "timeStart") @DateTimeFormat(iso = ISO.DATE_TIME) ZonedDateTime timeStart)

findZYZ控制器带有@DateTimeFormat之类的注释

if (this.route.snapshot.queryParams['welcome']) {
  setTimeout(() => {
    this.toastr.success('Register Successful, please login');
  });
}

这似乎是一种回归,但也许我缺少一些东西吗?

0 个答案:

没有答案