简体   繁体   English

Swagger-ui 锚链接到模型定义

[英]Swagger-ui anchor link to model definitions

Is it possible to access a model definition of via swagger-ui directly via an anchor?是否可以直接通过锚点访问 via swagger-ui 的模型定义?

In the example page http://petstore.swagger.io/ I see that the anchor works for a groups of endpoints, eg http://petstore.swagger.io/#/pet .在示例页面http://petstore.swagger.io/ 中,我看到锚点适用于一组端点,例如http://petstore.swagger.io/#/pet

Hovering the mouse over a model description shows me an anchor (eg #/definitions/Category for the Category model), but http://petstore.swagger.io/#/definitions/Category does not bring me there.将鼠标悬停在模型描述上会向我显示一个锚点(例如, Category模型的#/definitions/Category ),但http://petstore.swagger.io/#/definitions/Category并没有带我到那里。

If I inspect the elements, I see a real link to anchor pet :如果我检查元素,我会看到一个指向锚pet的真实链接:

<a class="nostyle" href="#/pet"><span>pet</span></a>

while for Category this is a model-hint :而对于Category这是一个模型提示

<span class="model-hint">#/definitions/Category</span>

So I wonder if anchoring models is supported at all..所以我想知道是否完全支持锚定模型..

Swagger UI does not support permalinks for schemas/models. Swagger UI 不支持模式/模型的永久链接。 There's an existing feature request:有一个现有的功能请求:
https://github.com/swagger-api/swagger-ui/issues/1369 https://github.com/swagger-api/swagger-ui/issues/1369

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM