diff --git a/apispec/ext/flask.py b/apispec/ext/flask.py
index 19c029f..a6c1e97 100644
--- a/apispec/ext/flask.py
+++ b/apispec/ext/flask.py
@@ -27,6 +27,11 @@ function to `add_path`. Inspects URL rules and view docstrings.
 from __future__ import absolute_import
 import re
 
+try:
+    from urllib.parse import urljoin
+except ImportError:
+    from urlparse import urljoin
+
 from flask import current_app
 
 from apispec.compat import iteritems
@@ -61,6 +66,8 @@ def path_from_view(spec, view, **kwargs):
     """Path helper that allows passing a Flask view function."""
     rule = _rule_for_view(view)
     path = flaskpath2swagger(rule.rule)
+    app_root = current_app.config['APPLICATION_ROOT'] or '/'
+    path = urljoin(app_root.rstrip('/') + '/', path.lstrip('/'))
     operations = utils.load_operations_from_docstring(view.__doc__)
     path = Path(path=path, operations=operations)
     return path

Flask extension does not support application root
The flask extension only outputs the route path, but `flask.url_for()` takes into consideration that the path should be prefixed with the configured `APPLICATION_ROOT` path. [apispec/ext/flask.py#L58](https://github.com/marshmallow-code/apispec/blob/1076180/apispec/ext/flask.py#L58)

 - http://flask.pocoo.org/docs/0.10/config/#builtin-configuration-values
 - https://github.com/pallets/flask/blob/9f1be8e/flask/helpers.py#L309
 - https://github.com/pallets/flask/blob/2bf477c/flask/app.py#L1761
diff --git a/tests/test_ext_flask.py b/tests/test_ext_flask.py
index 0f6f292..eeb4a03 100644
--- a/tests/test_ext_flask.py
+++ b/tests/test_ext_flask.py
@@ -105,3 +105,36 @@ class TestPathHelpers:
 
         spec.add_path(view=get_pet)
         assert '/pet/{pet_id}' in spec._paths
+
+    def test_path_includes_app_root(self, app, spec):
+
+        app.config['APPLICATION_ROOT'] = '/app/root'
+
+        @app.route('/partial/path/pet')
+        def get_pet():
+            return 'pet'
+
+        spec.add_path(view=get_pet)
+        assert '/app/root/partial/path/pet' in spec._paths
+
+    def test_path_with_args_includes_app_root(self, app, spec):
+
+        app.config['APPLICATION_ROOT'] = '/app/root'
+
+        @app.route('/partial/path/pet/{pet_id}')
+        def get_pet(pet_id):
+            return 'representation of pet {pet_id}'.format(pet_id=pet_id)
+
+        spec.add_path(view=get_pet)
+        assert '/app/root/partial/path/pet/{pet_id}' in spec._paths
+
+    def test_path_includes_app_root_with_right_slash(self, app, spec):
+
+        app.config['APPLICATION_ROOT'] = '/app/root/'
+
+        @app.route('/partial/path/pet')
+        def get_pet():
+            return 'pet'
+
+        spec.add_path(view=get_pet)
+        assert '/app/root/partial/path/pet' in spec._paths

pip install -e .
parse_log_pytest
requirements.txt
pytest
3.9
dev-requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
-e git+https://github.com/marshmallow-code/apispec.git@fe3f7a02358e65a7942d3d5d4d81c6a17844c6ce#egg=apispec
backports.tarfile==1.2.0
blinker==1.9.0
cachetools==5.5.2
certifi==2025.1.31
cffi==1.17.1
chardet==5.2.0
charset-normalizer==3.4.1
click==8.1.8
colorama==0.4.6
cryptography==44.0.2
distlib==0.3.9
docutils==0.21.2
exceptiongroup==1.2.2
filelock==3.18.0
flake8==2.5.4
Flask==3.1.0
id==1.5.0
idna==3.10
importlib_metadata==8.6.1
iniconfig==2.1.0
invoke==2.2.0
itsdangerous==2.2.0
jaraco.classes==3.4.0
jaraco.context==6.0.1
jaraco.functools==4.1.0
jeepney==0.9.0
Jinja2==3.1.6
keyring==25.6.0
markdown-it-py==3.0.0
MarkupSafe==3.0.2
marshmallow==3.26.1
mccabe==0.4.0
mdurl==0.1.2
mock==5.2.0
more-itertools==10.6.0
nh3==0.2.21
packaging==24.2
pep8==1.7.1
platformdirs==4.3.7
pluggy==1.5.0
pycparser==2.22
pyflakes==1.0.0
Pygments==2.19.1
pyproject-api==1.9.0
pytest==8.3.5
PyYAML==6.0.2
readme_renderer==44.0
requests==2.32.3
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==14.0.0
SecretStorage==3.3.3
tomli==2.2.1
tornado==6.4.2
tox==4.25.0
twine==6.1.0
typing_extensions==4.13.0
urllib3==2.3.0
virtualenv==20.29.3
Werkzeug==3.1.3
zipp==3.21.0

name: apispec
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - backports-tarfile==1.2.0
      - blinker==1.9.0
      - cachetools==5.5.2
      - certifi==2025.1.31
      - cffi==1.17.1
      - chardet==5.2.0
      - charset-normalizer==3.4.1
      - click==8.1.8
      - colorama==0.4.6
      - cryptography==44.0.2
      - distlib==0.3.9
      - docutils==0.21.2
      - exceptiongroup==1.2.2
      - filelock==3.18.0
      - flake8==2.5.4
      - flask==3.1.0
      - id==1.5.0
      - idna==3.10
      - importlib-metadata==8.6.1
      - iniconfig==2.1.0
      - invoke==2.2.0
      - itsdangerous==2.2.0
      - jaraco-classes==3.4.0
      - jaraco-context==6.0.1
      - jaraco-functools==4.1.0
      - jeepney==0.9.0
      - jinja2==3.1.6
      - keyring==25.6.0
      - markdown-it-py==3.0.0
      - markupsafe==3.0.2
      - marshmallow==3.26.1
      - mccabe==0.4.0
      - mdurl==0.1.2
      - mock==5.2.0
      - more-itertools==10.6.0
      - nh3==0.2.21
      - packaging==24.2
      - pep8==1.7.1
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - pycparser==2.22
      - pyflakes==1.0.0
      - pygments==2.19.1
      - pyproject-api==1.9.0
      - pytest==8.3.5
      - pyyaml==6.0.2
      - readme-renderer==44.0
      - requests==2.32.3
      - requests-toolbelt==1.0.0
      - rfc3986==2.0.0
      - rich==14.0.0
      - secretstorage==3.3.3
      - tomli==2.2.1
      - tornado==6.4.2
      - tox==4.25.0
      - twine==6.1.0
      - typing-extensions==4.13.0
      - urllib3==2.3.0
      - virtualenv==20.29.3
      - werkzeug==3.1.3
      - zipp==3.21.0
prefix: /opt/conda/envs/apispec

tests/test_ext_flask.py::TestPathHelpers::test_path_includes_app_root tests/test_ext_flask.py::TestPathHelpers::test_path_with_args_includes_app_root tests/test_ext_flask.py::TestPathHelpers::test_path_includes_app_root_with_right_slash
tests/test_ext_flask.py::TestPathHelpers::test_integration_with_docstring_introspection
tests/test_ext_flask.py::TestPathHelpers::test_path_from_view tests/test_ext_flask.py::TestPathHelpers::test_path_with_multiple_methods tests/test_ext_flask.py::TestPathHelpers::test_path_is_translated_to_swagger_template
apispec/ext/flask.py
apispec/ext/flask.py