Generation of .yml file with springdoc-openapi-maven-plugin doesn't escape date

Viewed 234

I'm using the plugin springdoc-openapi-maven-plugin as described in https://springdoc.org/#plugins.

I'm using this plugin to create my .yml file based on the swagger annotations on my controllers and dto's.

I can generate the .yml file successfully. But the only thing that's not correct is the 'date' values. These are not within quotes ("").

So for example this is how my generated .yml file looks like:

...
createdAt: 2022-02-24T11:43:38Z
...

But I expect date values to be within quotes, like:

...
createdAt: "2022-02-24T11:43:38Z"
...

The class I've applied the annotation on:

public class UserDto {

    @Schema(format = "date-time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'")
    private LocalDateTime createdAt;

}

Does anyone have any idea what's wrong, or how I can fix this?

Thank you!

0 Answers
Related