-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b614a6
commit 3b398dc
Showing
7 changed files
with
322 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
language: python | ||
|
||
python: | ||
- 2.7 | ||
- 3.6 | ||
|
||
before_install: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
""" | ||
This tests the use of `decorator` package with Flasgger | ||
""" | ||
from decorator import decorator | ||
from flask import Flask, jsonify | ||
from flasgger import Swagger | ||
|
||
app = Flask(__name__) | ||
Swagger(app) | ||
|
||
|
||
@decorator | ||
def trace(f, *args, **kw): | ||
kwstr = ', '.join('%r: %r' % (k, kw[k]) for k in sorted(kw)) | ||
print("calling %s with args %s, {%s}" % (f.__name__, args, kwstr)) | ||
return f(*args, **kw) | ||
|
||
|
||
@app.route('/') | ||
@trace | ||
def index(): | ||
""" | ||
This example tests decorator package | ||
Should not break in Python 2.7+ | ||
--- | ||
responses: | ||
200: | ||
description: Yeah it works | ||
""" | ||
return jsonify({'data': 'It works'}) | ||
|
||
|
||
if __name__ == '__main__': | ||
app.run(debug=True) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
|
||
__version__ = '0.6.2' | ||
__version__ = '0.6.3' | ||
__author__ = 'Bruno Rocha' | ||
__email__ = 'rochacbruno@gmail.com' | ||
|
||
|
||
from jsonschema import ValidationError # noqa | ||
from .base import Swagger, NO_SANITIZER, BR_SANITIZER, MK_SANITIZER # noqa | ||
from .base import Swagger, Flasgger, NO_SANITIZER, BR_SANITIZER, MK_SANITIZER # noqa | ||
from .utils import swag_from, validate, apispec_to_template # noqa | ||
from .marshmallow_apispec import APISpec, SwaggerView, Schema, fields # noqa |
Oops, something went wrong.