Can the swagger editor online take a YAML url as input through the address bar?

断了今生、忘了曾经 提交于 2020-02-24 20:20:36

问题


I want to access https://editor.swagger.io/ but need the YAML file to be preloaded based on a URL parameter.

So if I want to view https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v3.0/petstore.yaml, I should be able to provide this as an input to swagger editor accessible over the internet.

Is this possible?


回答1:


Yes, Swagger Editor supports the url parameter:

http://editor.swagger.io/?url=https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml

Note that to load OpenAPI files from GitHub/GitLab/Bitbucket/etc., you need to specify the "raw" file link.



来源:https://stackoverflow.com/questions/52975434/can-the-swagger-editor-online-take-a-yaml-url-as-input-through-the-address-bar

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