From 0717d3a8640bd6ca6a81ba7058c4d4c6663e32d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20L=C3=B6hel?= Date: Tue, 11 May 2021 17:38:26 -0500 Subject: [PATCH 1/2] The Flask/Blueprint API moved to the Scaffold base class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed in: https://github.com/pallets/flask/commit/b146a13f633b0e2e26e3b8383b3db0feb563bc83 Fixes: #308 Signed-off-by: Jürgen Löhel --- flask_restx/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_restx/api.py b/flask_restx/api.py index f1f69664..f9724670 100644 --- a/flask_restx/api.py +++ b/flask_restx/api.py @@ -17,7 +17,7 @@ from flask import url_for, request, current_app from flask import make_response as original_flask_make_response -from flask.helpers import _endpoint_from_view_func +from flask.scaffold import _endpoint_from_view_func from flask.signals import got_request_exception from jsonschema import RefResolver From 0dbcd4b10d8751cb637245634f0cb10b37ef861e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20L=C3=B6hel?= Date: Tue, 11 May 2021 17:44:30 -0500 Subject: [PATCH 2/2] Ensure backward compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jürgen Löhel --- flask_restx/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flask_restx/api.py b/flask_restx/api.py index f9724670..e7b08e22 100644 --- a/flask_restx/api.py +++ b/flask_restx/api.py @@ -17,7 +17,10 @@ from flask import url_for, request, current_app from flask import make_response as original_flask_make_response -from flask.scaffold import _endpoint_from_view_func +try: + from flask.helpers import _endpoint_from_view_func +except ImportError: + from flask.scaffold import _endpoint_from_view_func from flask.signals import got_request_exception from jsonschema import RefResolver