flask2postman icon indicating copy to clipboard operation
flask2postman copied to clipboard

Support Postman Collection Format v2

Open LucasHild opened this issue 4 years ago • 2 comments

This pull requests adds support for Postman Collection Format v2.1.0. This change has been asked for in issue #9. The schema of this collection format can be found here: https://schema.getpostman.com/collection/json/v2.1.0/draft-07/docs/index.html

The default output format now is v2.1.0. I added an argument which lets the user export using v1:

flask2postman example.app --name "Example Collection" -v1 -i > example.json

LucasHild avatar Oct 03 '19 13:10 LucasHild

Thanks for the work @Lanseuo! My last comment still stands but we're almost there. :fire:

ramnes avatar Apr 19 '20 12:04 ramnes

Hey @ramnes, thanks for your review!

I tried to solve your concerns from your last comment. Unfortunately, it's impossible to only use the werkzeug.Map object due to the fact that the properties blueprints and view_functions from the Flask app instance are required. Thus, I created a class method from_flask that allows you to instantiate the collection from the flask app instance. This has the advantage that now different web frameworks could be easier implemented.

I also renamed the Blueprint class to Folder to use a more general term that is not unique to Flask.

LucasHild avatar Apr 25 '20 21:04 LucasHild