So, I downloaded the files in the dist folder, and installed those into /var/lib/swagger/ on SecureCI TM. The instructions on the README.md file work quite well. I decided to install the swagger-ui (viewer) from that repo, leaving the swagger-editor out, as something that users should be able to do locally.
#SWAGGER EDITOR SAVE TO README.MD HOW TO#
I decided to figure out how to install the Swagger viewer into our SecureCI TM machine.Īfter scouring the web for a bit, I eventually found a nice github repo with a bunch of swagger tools. Previously, we were having to paste this YAML file into the swagger io editor, but this presents a few issues, the worst being potentially exposing your code to the outside world. This way, each time new APIs were added, or changes were made to our APIs, we would also update this YAML file, which would keep everything in-sync. We created a YAML file for our swagger doc, and put this document in our git repo. One of the main reasons we went with Swagger is because of it’s lightweight, relatively easy to write-up, and provides not just documentation, but also the ability to run queries from the documentation itself. So I decided to build a process to fix this into our DevOps pipeline. The big issue we ran into was that Swagger lacked the capability to quickly and easily display Swagger documents to the whole team. We wanted these APIs documented to assist with both understanding what was available to use, and also to assist with testing, and decided to go with Swagger. Our PHP application is using Laravel as the back end, and we are utilizing the inherent capabilities to setup PHP APIs to pass information back and forth from our UI to the back-end. While I promised this post would cover setting up CD for your pipeline, I realized that I left out a fairly useful (but in my mind unique) part of the process. On my last two posts I went through setting up CI for your PHP project.