Skip to content

Commit 84dd8e3

Browse files
committed
default port 5000,update readme
1 parent c6b4308 commit 84dd8e3

File tree

3 files changed

+38
-12
lines changed

3 files changed

+38
-12
lines changed

README.md

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
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

2626
Command 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+
6591
Install example-app requirements:
6692

6793
$ cd example-app

swagger_py_codegen/command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def print_version(ctx, param, value):
8383
@click.option('-j', '--jobs',
8484
default=4, help='Parallel jobs for processing.')
8585
@click.option('-tlp', '--templates',
86-
default='flask', help='gen flask/tornado templates.')
86+
default='flask', help='gen flask/tornado templates,default flask.')
8787
@click.option('--version', is_flag=True, callback=print_version,
8888
expose_value=False, is_eager=True,
8989
help='Show current version.')

swagger_py_codegen/templates/tornado/core.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,5 @@ class Config(object):
101101
URIS = []
102102
ROUTES = []
103103
DEBUG = True
104-
PORT = 8000
104+
PORT = 5000
105105
WORKER = 1

0 commit comments

Comments
 (0)