问题
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