Swagger UI 不显示operationId
Swagger UI does not display operationId
我们的 C# Asp.NET(非核心)REST API 使用 Swashbuckle nuget 包(感谢 Richard Morris)v5.6 生成 swagger 定义和 UI 页面。问题是 operationId 没有显示在 UI 页面上。
我可以在几个页面上看到 .net 核心版本包含一个神秘的 DisplayOperationId=true 配置设置来(无望地)解决这个问题。但是在非 .net 核心版本中我找不到这个设置,也看不到如何自定义 UI 来显示那条信息的工作示例。
有人可以帮我解决这个问题吗?提前致谢!
根据文档...
displayOperationId DISPLAY_OPERATION_ID Boolean=false. Controls the
display of operationId in operations list. The default is false.
https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/
url 中的查询参数 &displayOperationId=true
可能有用。
测试:
https://petstore.swagger.io/?displayOperationId=1
参考:
https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/#displayOperationId
我们的 C# Asp.NET(非核心)REST API 使用 Swashbuckle nuget 包(感谢 Richard Morris)v5.6 生成 swagger 定义和 UI 页面。问题是 operationId 没有显示在 UI 页面上。
我可以在几个页面上看到 .net 核心版本包含一个神秘的 DisplayOperationId=true 配置设置来(无望地)解决这个问题。但是在非 .net 核心版本中我找不到这个设置,也看不到如何自定义 UI 来显示那条信息的工作示例。
有人可以帮我解决这个问题吗?提前致谢!
根据文档...
displayOperationId DISPLAY_OPERATION_ID Boolean=false. Controls the display of operationId in operations list. The default is false.
https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/
url 中的查询参数 &displayOperationId=true
可能有用。
测试:
https://petstore.swagger.io/?displayOperationId=1
参考:
https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/#displayOperationId