Update Flask code with new code generated by Swagger

Viewed 1516

I recently started using Swagger to generate flask templates: http://editor.swagger.io/#/

My workflow is flawed, and I am wondering where I am going wrong. I:

  1. Use the UI to write the API V1 .yaml
  2. Generate the code using the UI editor, which downloads a stubbed out zip
  3. Write the functions that were stubbed out

This part of the process is fine. However, let's say we want to add a new endpoint or change an existing endpoint. Now what? I:

  1. reload the swagger editor
  2. edit the yaml
  3. generate the code, which downloads a new zip and blows away the old code
  4. take the newly generated code and do a "self-merge" where I copy over the new stub into the old code and copy over the new yaml into the old

It seems there is a gap between the initial generation of the flask template and ongoing maintenance. What am I doing wrong?

1 Answers
Related