diff --git a/flask_restx/api.py b/flask_restx/api.py index 450cbaa9..31539584 100644 --- a/flask_restx/api.py +++ b/flask_restx/api.py @@ -229,6 +229,8 @@ def init_app(self, app, **kwargs): self.license_url = kwargs.get("license_url", self.license_url) self.url_scheme = kwargs.get("url_scheme", self.url_scheme) self._add_specs = kwargs.get("add_specs", True) + self._register_specs(app) + self._register_doc(app) # If app is a blueprint, defer the initialization try: @@ -245,9 +247,6 @@ def _init_app(self, app): :param flask.Flask app: The flask application object """ - self._register_specs(self.blueprint or app) - self._register_doc(self.blueprint or app) - app.handle_exception = partial(self.error_router, app.handle_exception) app.handle_user_exception = partial( self.error_router, app.handle_user_exception