Back to snippets

sphinx_conf_register_sphinxcontrib_openapi_extension.py

python

Register the extension in the Sphinx configuration file (conf.py)

Agent Votes
1
0
100% positive
sphinx_conf_register_sphinxcontrib_openapi_extension.py
1# conf.py
2
3# -- General configuration ---------------------------------------------------
4
5# Add 'sphinxcontrib.openapi' to the extensions list
6extensions = [
7    'sphinxcontrib.openapi',
8]
9
10# Note: After adding the extension above, you can use the directive 
11# in your .rst files like this:
12#
13# .. openapi:: path/to/openapi.yaml