Skip to content

Commit

Permalink
About issue #80
Browse files Browse the repository at this point in the history
  • Loading branch information
rochacbruno committed Apr 1, 2017
1 parent 1b614a6 commit 3b398dc
Show file tree
Hide file tree
Showing 7 changed files with 322 additions and 272 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: python

python:
- 2.7
- 3.6

before_install:
Expand Down
3 changes: 3 additions & 0 deletions HISTORY
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Changelog

These are all the changes in Flasgger since the 0.6.0 release

0.6.3
-----
- HOTFIX: Support views using `decorator` package (#80)

0.6.2
-----
Expand Down
35 changes: 35 additions & 0 deletions examples/decorator_package.py
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)

4 changes: 2 additions & 2 deletions flasgger/__init__.py
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

0 comments on commit 3b398dc

Please sign in to comment.