How to set @ApiModelProperty dataType to String for Swagger documentation

后端 未结 3 732
[愿得一人]
[愿得一人] 2021-01-17 09:40

I am using Spring MVC (via Spring Boot) and have integrated Swagger API documentation using the swagger-spring-mvc library.

I have a class that looks something like

3条回答
  •  悲&欢浪女
    2021-01-17 10:05

    For OpenApi (Swagger 3.0) and SpringDoc the following global configuration could be used.

    static {
         SpringDocUtils.getConfig().replaceWithSchema(Money.class, new StringSchema());
    }
    

提交回复
热议问题