我有 Springboot 项目,我想在其中记录我的 API:
这是正在处理的 Web 服务的示例:
@ApiResponses(
value = {
@ApiResponse(responseCode = "200", content = @Content(
mediaType = "*/*",
schema = @Schema(implementation = Object.class),
examples = {
@ExampleObject(name = "boo",
summary = "example of boo",
ref = "#/swagger/Planner/semi_planif_200_response.json")
}
))
}
)
@PostMapping(value = "/startSemiPlanification", produces = "application/json")
private ResponseEntity<Object> startSemiPlanner( @RequestBody PlanificationDto planificationData,
@RequestParam(name = "groupByUserCode", required = false) Optional<Boolean> groupByUserCode,
@RequestParam(name = "range", defaultValue = "18") Integer range
Run Code Online (Sandbox Code Playgroud)
我的问题是 Swagger 无法解析此引用 ref = "#/swagger/Planner/semi_planif_200_response.json" 我什至尝试过使用绝对路径,但它不起作用:

这是文件路径: