我正在尝试生成带有招摇注解的文档。当我生成yml文件时,我看到很多错误,例如:“ $ refs必须引用文档中的有效位置”以获取错误代码。 即使我没有定义错误响应,我也会看到:$ ref:'#/ definitions / ErrorResponse'。对于定义的错误响应,我也看到同一行。
这是代码示例:
@ApiOperation(value = "Get details about an account")
@ApiResponses({
@ApiResponse(code = 401, message = "Unauthorized : Account ID unknown", response = ServiceErrorResponse.class),
@ApiResponse(code = 401, message = "Unauthorized : Unknown consent", response = ServiceErrorResponse.class),
@ApiResponse(code = 403, message = "Consent unknown", response = BerlinGroupErrorResponse.class),
@ApiResponse(code = 503, message = "Service unavailable")
})
AccountResponse getAccountDetails(@ApiParam(value = "Account identifier", required = true) String accountId,
@ApiParam(value = "Include the booking balance in the account details") Boolean withBalance);
并使用@ApiModel(description =“其他错误信息”)注释对ServiceErrorResponse进行注释