Skip to content

Instantly share code, notes, and snippets.

@frnhr
Created January 30, 2017 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frnhr/f6b135ae6f4bd97c66466d0c6a11e9c1 to your computer and use it in GitHub Desktop.
Save frnhr/f6b135ae6f4bd97c66466d0c6a11e9c1 to your computer and use it in GitHub Desktop.
StopLight IO workflow for hosted docs from Django Rest Framework docstrings

Setup

One-time only.

  1. We export a Swagger spec file (api_swagger.json) from DRF code and import it into StopLight as a new API, first version.
  2. Commit this file on dev branch on GitHub.
  3. In StopLight we make any necessary changes:
    • assign groups to the API endpoints
    • we should not edit descriptions that were imported, because of possible Git merge conflicts later on
  4. Export a Swagger spec file from StopLight.
  5. Commit that file as an update to api_swagger.json onto our staging branch on GitHub.

Dev workflow

  1. Developers make a change in our Python code, and update the docstrings accordingly.
  2. On git commit (on their feature branches), a git hook (custom built) will update api_swagger.json
  3. Pull requests dev -> staging will trigger a webhook (custom built) that will PUT the now MERGED api_swagger.json from staging to StopLight.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment