What are the options for swagger-editor to save js

2019-06-28 07:13发布

问题:

I know that the Swagger-editor saves api documentation into the local browser cache ("Download Yaml/Json" and "Export Yaml/Json").

But what if I want to save it into a remote server then latter I can continue editing it from another browser.

Are there already known Backends for Swagger-editor which I can use?

Thanks in advance.

回答1:

The swagger-node project has the editor built in and saves files in your filesystem.

Follow the steps in the README to install and run. When you make changes in the editor that you launch (your browser), they are autosaved, and you can see the change in the api directory. For example, if you change the { info: { title } } key, you'll see it autosave and then you can see the change in ./api/swagger/swagger.yaml.



回答2:

There is an option to useBackendForStorage: true which does a HTTP put to a backend server.



回答3:

Little late to the game, but maybe helps others:

There is a very simple backend here, written in go: https://github.com/zgiber/sweb

It runs as a http server on your localhost, and opens the editor in a browser. Saves the swagger file as you type.