Swagger OpenAPI生成器中的Bug?日期数据类型的示例值格式错误

Swagger OpenAPI生成器中的Bug?日期数据类型的示例值格式错误,swagger,swagger-ui,openapi,springfox,openapi-generator,Swagger,Swagger Ui,Openapi,Springfox,Openapi Generator,我正在使用4.2.3版本的openapi生成器maven插件 我的配置如下所示: <typeMappings> <typeMapping>OffsetDate=LocalDate</typeMapping> <typeMapping>OffsetDateTime=LocalDateTime&l

我正在使用4.2.3版本的openapi生成器maven插件

我的配置如下所示:

                       <typeMappings>
                            <typeMapping>OffsetDate=LocalDate</typeMapping>
                            <typeMapping>OffsetDateTime=LocalDateTime</typeMapping>
                        </typeMappings>
                        <importMappings>
                            <importMapping>java.time.OffsetDate=java.time.LocalDate</importMapping>
                            <importMapping>java.time.OffsetDateTime=java.time.LocalDateTime</importMapping>
                        </importMappings>
                        <!-- pass any necessary config options -->
                        <configOptions>
                            <java8>true</java8>
                            <skipDefaultInterface>true</skipDefaultInterface>
                            <dateLibrary>java8</dateLibrary>
                            <interfaceOnly>true</interfaceOnly>
                            <swaggerDocketConfig>false</swaggerDocketConfig>
                            <hateoas>true</hateoas>
                        </configOptions>
但这个例子被插件忽略了:在我生成的代码中,我有:

  @ApiModelProperty(example = "Thu Oct 11 02:00:00 CEST 2012", required = true, value = "My date")
我想在我的yaml文件中有一个这样的例子。YYYY-MM-DD格式

我正在使用:


伊奥·斯普林福克斯
springfox-Swagger 2
3.0.0-SNAPSHOT
伊奥·斯普林福克斯
springfox招摇过市用户界面
3.0.0-SNAPSHOT
伊奥·斯普林福克斯
SpringFoxSpringWebMVC
3.0.0-SNAPSHOT
org.openapitools
jackson数据绑定可为空
0.1.0
com.fasterxml.jackson.dataformat
jackson数据格式xml
2.10.2

几个小时后,我找到了解决办法:

我的日期: 类型:“日期” 格式:“yyyy-mm-dd” 描述:“我的约会”
示例:“2012-10-11”

我不能使用类似于type
date的东西,因为它是说使用一个建议的日期。您是如何使用该日期的?
  @ApiModelProperty(example = "Thu Oct 11 02:00:00 CEST 2012", required = true, value = "My date")
    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger2</artifactId>
        <version>3.0.0-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger-ui</artifactId>
        <version>3.0.0-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-spring-webmvc</artifactId>
        <version>3.0.0-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>org.openapitools</groupId>
        <artifactId>jackson-databind-nullable</artifactId>
        <version>0.1.0</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.dataformat</groupId>
        <artifactId>jackson-dataformat-xml</artifactId>
        <version>2.10.2</version>
    </dependency>