From ee0727bfb309a307fc8e115f967d4aced2816cd9 Mon Sep 17 00:00:00 2001 From: jf Date: Sun, 4 Jun 2023 16:44:53 +0200 Subject: [PATCH] updated flask and flasgger --- main.py | 3 ++- requirements.txt | 2 +- test/test_api.py | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 0313a25..258033a 100644 --- a/main.py +++ b/main.py @@ -34,7 +34,8 @@ def create_app(test_config=None): # Restful API hookup app.register_blueprint(rest_api.api_bp) - app.json_encoder = LazyJSONEncoder + app.json_provider_class = LazyJSONEncoder + app.json = LazyJSONEncoder(app) dirname = os.path.dirname(__file__) with open(os.path.join(dirname, 'matweb/oas/components.yml')) as file: diff --git a/requirements.txt b/requirements.txt index e540321..a9a52fb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,5 +8,5 @@ Flask-Cors==3.0.10 Cerberus==1.3.4 Flask-Testing==0.8.1 blinker==1.6.2 -flasgger==0.9.5 +flasgger==0.9.7b2 Flask-Assets==2.0 diff --git a/test/test_api.py b/test/test_api.py index e83021a..2f52279 100644 --- a/test/test_api.py +++ b/test/test_api.py @@ -474,7 +474,6 @@ class Mat2APITestCase(unittest.TestCase): def test_valid_opena_api_spec(self): spec = self.app.get('apispec_1.json').get_json() # Test workaround due to https://github.com/flasgger/flasgger/issues/374 - del spec['definitions'] validate_spec(spec) def test_remove_metadata(self):