【问题标题】:How does the @ApiOperation annotation workd in spring?@ApiOperation 注解在 spring 中是如何工作的?
【发布时间】:2021-02-15 17:49:11
【问题描述】:

我想知道 spring @ApiOperation(value = "", hidden = true) 的注释是否可以在我的招摇页面上隐藏信息。

  1. 哪个类负责加载注解
  2. 注释的相同值有什么作用。

在哪里可以找到注释的工作原理?

【问题讨论】:

标签: spring springfox


【解决方案1】:

springfox.documentation.spring.web.readers.operation.ApiOperationReader.read(RequestMappingContext) 方法协调扫描带有 @ApiOperation 注释的方法,并在执行此操作时考虑到 hidden 标志,您可以在源代码中看到它GitHub

可以在here找到扫描带注释的方法并使用有关是否应隐藏该方法的信息填充上下文的特定方法。

您可以继续浏览源代码以获取有关实现的更多信息,也可以在https://github.com/swagger-api/swagger-core/wiki/annotations#apioperation 上获取有关@ApiOperation 注释的更多信息。

【讨论】:

    猜你喜欢
    • 2011-04-01
    • 2015-09-29
    • 2021-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-13
    • 2015-10-09
    相关资源
    最近更新 更多