We have a Spring Boot 2 application with Springfox 2.9.2 to describe the API and we have marked our API with Swagger annotations @ApiModelProperty. We have something like this in our API:
@ApiModelProperty(value = "mumbo-jumbo", dataType = "java.time.LocalDate", example = "2018-03-20")
private String paymentAccountAge;
We have configured Swagger2 via Springfox as follows:
return new Docket(DocumentationType.SWAGGER_2)
...
.alternateTypeRules(
...
newRule(typeResolver.resolve(LocalDate.class), typeResolver.resolve(String.class)),
...)
However the Swagger Documentation Page is producing errors:
Errors
Hide
Resolver error at paths./startAuth.post.parameters.1.schema.properties.accountInfo.properties.paymentAccountAge.$ref
Could not resolve reference because of: Could not resolve pointer: /definitions/LocalDate does not exist in document
Any idea why Swagger2 ist not working properly?
springfox
you are using? – SSK2.9.2
does not supportLocalDate
try using latest3.0.0
– SSK