Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swagger-ui anchor link to model definitions

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

like image 354
user1981275 Avatar asked Oct 19 '17 10:10

user1981275


People also ask

What is deep linking in swagger?

Swagger UI allows you to deeply link into tags and operations within a spec. When Swagger UI is provided a URL fragment at runtime, it will automatically expand and scroll to a specified tag or operation.


1 Answers

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

like image 80
Helen Avatar answered Sep 22 '22 05:09

Helen