Skip to content

Commit f6172d9

Browse files
committed
Validate OpenAPI spec
1 parent ac95c72 commit f6172d9

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
'pytest-cov >= 2.6.1, < 3.0.0',
3333
'mypy >= 0.701, < 0.800',
3434
'openfisca-country-template >= 3.10.0, < 4.0.0',
35-
'openfisca-extension-template >= 1.2.0rc0, < 2.0.0'
35+
'openfisca-extension-template >= 1.2.0rc0, < 2.0.0',
36+
'openapi-spec-validator >= 0.3.0',
3637
] + api_requirements
3738

3839
setup(

tests/web_api/test_spec.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import dpath
77
from . import subject
88

9+
from openapi_spec_validator import validate_spec
10+
911

1012
def assert_items_equal(x, y):
1113
assert sorted(x) == sorted(y)
@@ -55,3 +57,7 @@ def test_situation_definition():
5557

5658
def test_host():
5759
assert 'http' not in body['host']
60+
61+
62+
def test_respects_spec():
63+
validate_spec(body)

0 commit comments

Comments
 (0)