Sign inSign up

zixia/swagger-edit

By zixia

•Updated over 9 years ago

Swagger-Editor for local files like VIM.

Image
0

1.5K

zixia/swagger-edit repository overview

⁠swagger-edit

Swagger-Editor for local files like VIM.

dockeri.co

⁠The Problem

The Swagger Editor⁠ is great.

However, It only open online URL. It can not open your local file directly, which is what I want to do.

How can we edit our swagger specification yaml file just like use a VIM?

$ swagger-edit my-api.yaml

That will be cool, also very convienence.

⁠The Solution

Use Swagger-Edit⁠ docker image!

To edit your my-api.yaml, just run:

$ docker run -ti --rm --volume="$(pwd)":/swagger -p 8080:8080 zixia/swagger-edit my-api.yaml

Then open your browser and goto the URL: http://127.0.0.1:8080/⁠, that's it.

Hope you like it!

⁠Tips

For more convenience, we can setup a function as a command(in bash):

$ function swagger-edit() {
  docker run -ti --rm --volume="$(pwd)":/swagger -p 8080:8080 zixia/swagger-edit "$@"
}

$ swagger-edit my-api.yaml

⁠Author

Zhuohuan LI [email protected]⁠ (http://linkedin.com/in/zixia⁠)

profile for zixia at Stack Overflow, Q&A for professional and enthusiast programmers ⁠
  • Code & Documentation 2017© zixia
  • Code released under the Apache 2.0 license
  • Docs released under Creative Commons

Tag summary

Content type

Image

Digest

Size

38.6 MB

Last updated

over 9 years ago

docker pull zixia/swagger-edit