1- # Flask RESTful Application Code Generator
1+ # Flask/Tornado RESTful Application Code Generator
22
33[ ![ Build Status] [ travis-image ]] [ travis-url ] [ ![ PyPi Version] [ pypi-image ]] [ pypi-url ]
44
55## Overview
66
7- Generate Flask-RESTful application code from a Swagger Specification doc.
7+ Generate Flask/Tornado -RESTful application code from a Swagger Specification doc.
88
99** Alpha version for now, it can not handle all validation properly.**
1010
@@ -25,13 +25,16 @@ swagger_py_codegen --swagger-doc api.yml example-app
2525
2626Command Options:
2727
28- -s, --swagger, --swagger-doc Swagger doc file. [required]
29- -f, --force Force overwrite.
30- -p, --package Package name / application name.
31- -t, --template-dir Path of your custom templates directory.
32- --spec, --specification Generate online specification json response.
33- --ui Generate swagger ui.
34- --help Show this message and exit.
28+ -s, --swagger, --swagger-doc Swagger doc file. [required]
29+ -f, --force Force overwrite.
30+ -p, --package Package name / application name.
31+ -t, --template-dir Path of your custom templates directory.
32+ --spec, --specification Generate online specification json response.
33+ --ui Generate swagger ui.
34+ -j, --jobs INTEGER Parallel jobs for processing.
35+ -tlp, --templates gen flask/tornado templates,default flask.
36+ --version Show current version.
37+ --help Show this message and exit.
3538
3639## Examples:
3740
@@ -42,7 +45,7 @@ Generate example-app from [apis.yml](https://github.com/guokr/swagger-py-codegen
4245 |__ api.yml
4346
4447 $ swagger_py_codegen -s api.yml example-app -p demo
45- $ tree
48+ $ tree (flask-demo)
4649 .
4750 |__ api.yml
4851 |__ example-app
@@ -62,6 +65,29 @@ Generate example-app from [apis.yml](https://github.com/guokr/swagger-py-codegen
6265 | |__ validators.py
6366 |__ requirements.txt
6467
68+ $ swagger_py_codegen -s docs/panel.yml example-app -p demo -tlp=tornado
69+ $ tree (tornado-demo)
70+ .
71+ |__ api.yml
72+ |__ example-app
73+ |__ demo
74+ | |__ __init__.py
75+ | |__ core
76+ | |__ __init.py
77+ | |__ v1
78+ | |__ api
79+ | | |__ __init__.py
80+ | | |__ oauth_auth_approach_approach.py
81+ | | |__ oauth_auth_approach.py
82+ | | |__ users_token.py
83+ | | |__ users_current.py
84+ | | |__ users.py
85+ | |__ __init__.py
86+ | |__ routes.py
87+ | |__ schemas.py
88+ | |__ validators.py
89+ |__ requirements.txt
90+
6591Install example-app requirements:
6692
6793 $ cd example-app
0 commit comments