Skip to content

Commit 17fd571

Browse files
Fix Intersphinx mapping errors with Flask + minor RST bugs
1 parent b92f0cb commit 17fd571

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

doc/errors.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ that you can do with Flask/Blueprint :meth:`@errorhandler <flask:flask.Flask.err
141141
@api.errorhandler(RootException)
142142
def handle_root_exception(error):
143143
'''Return a custom message and 400 status code'''
144-
return {'message': 'What you want'}, 400
145-
144+
return {'message': 'What you want'}, 400
145+
146146
147147
@api.errorhandler(CustomException)
148148
def handle_custom_exception(error):
@@ -160,14 +160,14 @@ that you can do with Flask/Blueprint :meth:`@errorhandler <flask:flask.Flask.err
160160
def handle_fake_exception_with_header(error):
161161
'''Return a custom message and 400 status code'''
162162
return {'message': error.message}, 400, {'My-Header': 'Value'}
163-
164-
163+
164+
165165
@api.errorhandler(NoResultFound)
166166
def handle_no_result_exception(error):
167167
'''Return a custom not found error message and 404 status code'''
168-
return {'message': error.specific}, 404
169-
170-
168+
return {'message': error.specific}, 404
169+
170+
171171
.. note ::
172172
173173
A "NoResultFound" error with description is required by the OpenAPI 2.0 spec. The docstring in the error handle function is output in the swagger.json as the description.

doc/quickstart.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ All you need to do is update your requirements to use Flask-RESTX instead of
2323
Flask-RESTPlus. Then you need to update all your imports.
2424
This can be done using something like:
2525

26-
::
26+
.. code-block:: bash
27+
2728
find . -type f -name "*.py" | xargs sed -i "s/flask_restplus/flask_restx/g"
2829
2930
Finally, you will need to update your configuration options (described `here
30-
<quickstart.html#configuration>`_). Example:
31+
<configuration.html>`_). Example:
32+
33+
.. code-block:: bash
3134
32-
::
3335
find . -type f -name "*.py" | xargs sed -i "s/RESTPLUS_/RESTX_/g"
3436
3537
@@ -112,7 +114,7 @@ See :ref:`swaggerui` for a complete documentation on the automatic documentation
112114
Resourceful Routing
113115
-------------------
114116
The main building block provided by Flask-RESTX are resources.
115-
Resources are built on top of :ref:`Flask pluggable views <flask:views>`,
117+
Resources are built on top of :doc:`Flask pluggable views <flask:views>`,
116118
giving you easy access to multiple HTTP methods just by defining methods on your resource.
117119
A basic CRUD resource for a todo application (of course) looks like this:
118120

doc/scaling.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Here's an example directory structure::
3838

3939

4040
The `app` module will serve as a main application entry point following one of the classic
41-
Flask patterns (See :ref:`flask:larger-applications` and :ref:`flask:app-factories`).
41+
Flask patterns (See :doc:`flask:patterns/packages` and :doc:`flask:patterns/appfactories`).
4242

4343
The `core` module is an example, it contains the business logic.
4444
In fact, you call it whatever you want, and there can be many packages.
@@ -151,7 +151,7 @@ Using this pattern, you simply have to register your API in `app.py` like that:
151151
Use With Blueprints
152152
-------------------
153153

154-
See :ref:`blueprints` in the Flask documentation for what blueprints are and why you should use them.
154+
See :doc:`flask:blueprints` in the Flask documentation for what blueprints are and why you should use them.
155155
Here's an example of how to link an :class:`Api` up to a :class:`~flask.Blueprint`.
156156

157157
.. code-block:: python

0 commit comments

Comments
 (0)