Skip to content

Commit 5e6b684

Browse files
committed
Compatibility with apispec v1.0.0
1 parent 5f4d378 commit 5e6b684

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: python
22
cache: pip
33
sudo: false
44
env:
5-
- APISPEC_VERSION="==1.0.0rc1"
5+
- APISPEC_VERSION=">=1.0.0"
66
- APISPEC_VERSION=""
77
- MARSHMALLOW_VERSION="==2.13.0"
88
- MARSHMALLOW_VERSION=""

flask_apispec/apidoc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,14 @@ def convert(self, target, endpoint=None, blueprint=None, **kwargs):
3939
def get_path(self, rule, target, **kwargs):
4040
operations = self.get_operations(rule, target)
4141
parent = self.get_parent(target, **kwargs)
42+
valid_methods = VALID_METHODS[self.spec.openapi_version.major]
4243
return {
4344
'view': target,
4445
'path': rule_to_path(rule),
4546
'operations': {
4647
method.lower(): self.get_operation(rule, view, parent=parent)
4748
for method, view in six.iteritems(operations)
48-
if method.lower() in (set(VALID_METHODS) - {'head'})
49+
if method.lower() in (set(valid_methods) - {'head'})
4950
},
5051
}
5152

@@ -84,7 +85,6 @@ def get_parameters(self, rule, view, docs, parent=None):
8485
locations = options.pop('locations', None)
8586
if locations:
8687
options['default_in'] = locations[0]
87-
options['spec'] = self.app.config.get('APISPEC_SPEC', None)
8888

8989
rule_params = rule_to_params(rule, docs.get('params')) or []
9090
extra_params = converter(schema, **options) if args else []

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
'flask>=0.10.1',
1010
'marshmallow>=2.0.0',
1111
'webargs>=0.18.0',
12-
'apispec==1.0.0rc1',
12+
'apispec>=1.0.0',
1313
]
1414

1515
def find_version(fname):

0 commit comments

Comments
 (0)