Swagger-ui anchor link to model definitions

浪尽此生 提交于 2020-08-24 06:43:06

问题


Is it possible to access a model definition of via swagger-ui directly via an anchor?

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.

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.

If I inspect the elements, I see a real link to anchor pet:

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

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..


回答1:


Swagger UI does not support permalinks for schemas/models. There's an existing feature request:
https://github.com/swagger-api/swagger-ui/issues/1369



来源:https://stackoverflow.com/questions/46827462/swagger-ui-anchor-link-to-model-definitions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!