java - 如何从外部资源为 @exampleProperty 注释提供值?
问题描述
我需要将示例属性的动态列表设置为 ApiResponse 的参数
@ApiResponses(value = {
@ApiResponse(code = 200,message = "Successfully"),
@ApiResponse(code = 400,
message = "Bad Request",
examples = @Example(value ={
**@ExampleProperty**(mediaType = "application/json",value = "\"400\": \"The format of field Value1 is invalid.\""),
**@ExampleProperty**(mediaType = "application/json",value = "\"400\": \"The format of field Value2 is invalid.\""),
**@ExampleProperty** ....
}))
})
如何从外部资源文件而不是 harcoding 为 @ExampleProperty 提供值?
解决方案
推荐阅读
- azure - 有没有办法将公共 LB 放在 Application Gateay 前面?
- python-3.x - 运行 python 脚本,在终端中观察并保存到文件
- typescript - 如何在打字稿中禁用隐式导入
- mysql - 尝试连接到托管在 Google Compute Engine Ubuntu VM 上的 SQL 服务器时,如何解决此错误
- android - KSOAP Android - ADBException:意外的子元素
- postgresql - 在 postgresql 中显示主表列表
- python - Python 服务器 NoneType/float catch
- c++ - Segfault with std::vector =-operation to uninitialized space
- c# - 带有光线投射命中错误的恒定 Y 轴
- python - pip install options "no-cache-dir" and "target" don't work well together?