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