swagger 在线编辑器可以通过地址栏输入一个 YAML url 作为输入吗? [英] Can the swagger editor online take a YAML url as input through the address bar?
问题描述
我想访问 https://editor.swagger.io/ 但需要 YAML 文件基于 URL 参数预加载.
所以如果我想查看 https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v3.0/petstore.yaml,我应该可以将其作为输入提供给可通过 Internet 访问的 swagger 编辑器.p>
这可能吗?
是的,Swagger Editor 支持 url
参数:
请注意,要从 GitHub/GitLab/Bitbucket/etc. 加载 OpenAPI 文件,您需要指定原始"文件.文件链接.
此外,要使其正常工作,托管 YAML/JSON 文件的服务器必须使用 HTTPS 和 支持CORS(即允许来自editor.swagger.io
的跨域调用).
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?
Yes, Swagger Editor supports the url
parameter:
Note that to load OpenAPI files from GitHub/GitLab/Bitbucket/etc., you need to specify the "raw" file link.
Also, for this to work, the server where the YAML/JSON file is hosted must use HTTPS and support CORS (i.e. allow cross-domain calls from editor.swagger.io
).
这篇关于swagger 在线编辑器可以通过地址栏输入一个 YAML url 作为输入吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!