Swagger-ui anchor link to model definitions(Swagger-ui 锚链接到模型定义)
问题描述
是否可以通过锚点直接访问通过 swagger-ui 的模型定义?
Is it possible to access a model definition of via swagger-ui directly via an anchor?
在示例页面 http://petstore.swagger.io/ 我看到锚适用于一组端点,例如http://petstore.swagger.io/#/pet.
In the example page http://petstore.swagger.io/ I see that the anchor works for a groups of endpoints, e.g. http://petstore.swagger.io/#/pet.
将鼠标悬停在模型描述上会显示一个锚点(例如 Category
模型的 #/definitions/Category
),但是http://petstore.swagger.io/#/definitions/Category 不带我在那里.
Hovering the mouse over a model description shows me an anchor (e.g. #/definitions/Category
for the Category
model), but
http://petstore.swagger.io/#/definitions/Category does not bring me there.
如果我检查元素,我会看到一个指向锚 pet
的真实链接:
If I inspect the elements, I see a real link to anchor pet
:
<a class="nostyle" href="#/pet"><span>pet</span></a>
而对于 Category
这是一个 model-hint:
while for Category
this is a model-hint:
<span class="model-hint">#/definitions/Category</span>
所以我想知道是否支持锚定模型..
So I wonder if anchoring models is supported at all..
推荐答案
Swagger UI 不支持模式/模型的永久链接.有一个现有的功能请求:
https://github.com/swagger-api/swagger-ui/issues/1369
Swagger UI does not support permalinks for schemas/models. There's an existing feature request:
https://github.com/swagger-api/swagger-ui/issues/1369
这篇关于Swagger-ui 锚链接到模型定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Swagger-ui 锚链接到模型定义


- 在不使用循环的情况下查找数字数组中的一项 2022-01-01
- 如何调试 CSS/Javascript 悬停问题 2022-01-01
- 我不能使用 json 使用 react 向我的 web api 发出 Post 请求 2022-01-01
- 是否可以将标志传递给 Gulp 以使其以不同的方式 2022-01-01
- 从原点悬停时触发 translateY() 2022-01-01
- 使用 iframe URL 的 jQuery UI 对话框 2022-01-01
- 如何显示带有换行符的文本标签? 2022-01-01
- 为什么我的页面无法在 Github 上加载? 2022-01-01
- 如何向 ipc 渲染器发送添加回调 2022-01-01
- 为什么悬停在委托事件处理程序中不起作用? 2022-01-01