spring boot3.x版本依赖于jakarta依赖包,但是swagger依赖底层应用的javax依赖包,所以只要一启动就会报错。
移除swagger2依赖
io.springfox springfox-swagger2 2.9.2 com.github.xiaoymin swagger-bootstrap-ui 1.9.0 provided
添加新依赖
org.springdoc springdoc-openapi-starter-webmvc-ui 2.1.0
@Api(tags = “”) → @Tag(name = “”)
@ApiModel(value=“”, description=“”) → @Schema(name=“”, description=“”)
@ApiModelProperty(value = “”, required = true) → @Schema(name= “”, description = “”, required = true)
@ApiOperation(value = “”, notes = “”) → @Operation(summary = “”, description = “”)
@ApiParam → @Parameter
@ApiResponse(code = 404, message = “”) → @ApiResponse(responseCode = “404”, description = “”)
上一篇:【Spring】aop的底层原理