Swagger-core: @ApiModelProperty 在 Annotations-2.X 中?

创建于 2017-11-02  ·  3评论  ·  资料来源: swagger-api/swagger-core

查看 Annotations 2.X的文档,有对 \@ ApiModelProperty 的引用。 但是,源代码中不存在此注释。 文档不正确吗? 还是来源不对? 在哪种情况下,它是有意删除,还是计划稍后添加?

3.0 spec support

最有用的评论

你们都是对的。 新版本中不存在 ApiModelProperty。 与模型相关的所有内容现在都使用@Schema注释处理。
非常感谢这个观察!
我们用这个更新了维基:

和/或架构属性:

@Schema(description = "pet status in the store", allowableValues = {"available","pending","sold"}) public String getStatus() { return status; }

所有3条评论

啊,我现在看到了。 过去在 ApiModelProperty 下的大部分内容现在都在 Schema 下。

这究竟是什么意思? 文档显示了这一点:

@ApiModelProperty(description = "pet status in the store", allowableValues =  {"available","pending","sold"})
  public String getStatus() {
    return status;
  }

但是该注释在 2.0.0-rc2 中不存在。 我应该如何记录班级中的字段?

你们都是对的。 新版本中不存在 ApiModelProperty。 与模型相关的所有内容现在都使用@Schema注释处理。
非常感谢这个观察!
我们用这个更新了维基:

和/或架构属性:

@Schema(description = "pet status in the store", allowableValues = {"available","pending","sold"}) public String getStatus() { return status; }

此页面是否有帮助?
0 / 5 - 0 等级