swagger-editor icon indicating copy to clipboard operation
swagger-editor copied to clipboard

Open custom yaml spec in swagger editor on startup

Open gsamartian opened this issue 8 years ago • 1 comments

I want to customize the default petstore yaml which gets opened whenever I open swagger editor.

Is there a way to customize it so that I can open a different swagger yaml spec whenever I open swagger editor.

gsamartian avatar Mar 27 '18 11:03 gsamartian

Yes!

You can use Swagger-UI's config options to load in your own definiton: there's url for fetching a remote document, and spec for passing in a JavaScript object directly. Swagger-Editor passes these options directly to its underlying Swagger-UI instance.

More info here: https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md#core

shockey avatar Mar 27 '18 18:03 shockey