Skip to content

Commit

Permalink
Fixed broken links in documentation.
Browse files Browse the repository at this point in the history
Also updated links to canonical locations to reduce redirects.

These were discovered using `make linkcheck`.

I did something similar a while back for Django:

    django/django#14325
  • Loading branch information
ngnpope committed Apr 20, 2022
1 parent 3d12a40 commit b1c7fd1
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 50 deletions.
70 changes: 35 additions & 35 deletions CHANGELOG.rst

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions README.rst
Expand Up @@ -37,7 +37,7 @@ Features
- Callback operations (experimental)
- Included support for:
- `django-polymorphic <https://github.com/django-polymorphic/django-polymorphic>`_ / `django-rest-polymorphic <https://github.com/apirobot/django-rest-polymorphic>`_
- `SimpleJWT <https://github.com/SimpleJWT/django-rest-framework-simplejwt>`_
- `SimpleJWT <https://github.com/jazzband/djangorestframework-simplejwt>`_
- `DjangoOAuthToolkit <https://github.com/jazzband/django-oauth-toolkit>`_
- `djangorestframework-jwt <https://github.com/jpadilla/django-rest-framework-jwt>`_ (tested fork `drf-jwt <https://github.com/Styria-Digital/django-rest-framework-jwt>`_)
- `dj-rest-auth <https://github.com/iMerica/dj-rest-auth>`_ (maintained fork of `django-rest-auth <https://github.com/Tivix/django-rest-auth>`_)
Expand All @@ -48,7 +48,7 @@ Features
- `djangorestframework-dataclasses <https://github.com/oxan/djangorestframework-dataclasses>`_


For more information visit the `documentation <https://drf-spectacular.readthedocs.io>`_.
For more information visit the `documentation <https://drf-spectacular.readthedocs.io/en/latest/>`_.

License
-------
Expand Down Expand Up @@ -289,16 +289,16 @@ globally, and then simply run:
.. _Django REST framework: https://www.django-rest-framework.org/
.. _OpenAPI 3.0: https://github.com/OAI/OpenAPI-Specification
.. _tox: http://tox.readthedocs.org/en/latest/
.. _tox: https://tox.wiki/en/latest/
.. _drf-spectacular-sidecar: https://github.com/tfranzel/drf-spectacular-sidecar

.. |build-status| image:: https://github.com/tfranzel/drf-spectacular/actions/workflows/ci.yml/badge.svg
:target: https://github.com/tfranzel/drf-spectacular/actions/workflows/ci.yml
.. |pypi-version| image:: https://img.shields.io/pypi/v/drf-spectacular.svg
:target: https://pypi.python.org/pypi/drf-spectacular
.. |codecov| image:: https://codecov.io/gh/tfranzel/drf-spectacular/branch/master/graph/badge.svg
:target: https://codecov.io/gh/tfranzel/drf-spectacular
:target: https://pypi.org/project/drf-spectacular/
.. |codecov| image:: https://app.codecov.io/gh/tfranzel/drf-spectacular/branch/master/graph/badge.svg
:target: https://app.codecov.io/gh/tfranzel/drf-spectacular
.. |docs| image:: https://readthedocs.org/projects/drf-spectacular/badge/
:target: https://drf-spectacular.readthedocs.io/
:target: https://drf-spectacular.readthedocs.io/en/latest/
.. |pypi-dl| image:: https://img.shields.io/pypi/dm/drf-spectacular
:target: https://pypi.org/project/drf-spectacular/
7 changes: 5 additions & 2 deletions docs/client_generation.rst
Expand Up @@ -59,8 +59,11 @@ field. Even though it is the correct way (according to the specification), it sa
Setting ``'ENUM_ADD_EXPLICIT_BLANK_NULL_CHOICE': False`` will create a less accurate schema that tends to offend
fewer generator targets.

For more information please refer to the `official documentation <https://swagger.io/docs/specification/data-models/enums/>`_ and
more specifically the `specification proposal <https://github.com/OAI/OpenAPI-Specification/blob/master/proposals/003_Clarify-Nullable.md#if-a-schema-specifies-nullable-true-and-enum-1-2-3-does-that-schema-allow-null-values-see-1900>`_.
For more information please refer to the `official documentation`__ and more specifically the `specification
proposal`__.

__ https://swagger.io/docs/specification/data-models/enums/
__ https://github.com/OAI/OpenAPI-Specification/blob/main/proposals/2019-10-31-Clarify-Nullable.md#user-content-if-a-schema-specifies-nullable-true-and-enum-1-2-3-does-that-schema-allow-null-values-see-1900

Relevant settings:

Expand Down
7 changes: 7 additions & 0 deletions docs/conf.py
Expand Up @@ -48,6 +48,13 @@

default_role = 'default-role-error'

linkcheck_ignore = [
# Special-use addresses and domain names. (RFC 6761/6890)
r"^https?://(?:127\.0\.0\.1|\[::1\])(?::\d+)?/",
r"^https?://(?:[^/\.]+\.)*example\.(?:com|net|org)(?::\d+)?/",
r"^https?://(?:[^/\.]+\.)*(?:example|invalid|localhost|test)(?::\d+)?/",
]

nitpicky = True

nitpick_ignore_regex = [
Expand Down
8 changes: 4 additions & 4 deletions drf_spectacular/extensions.py
Expand Up @@ -23,7 +23,7 @@ class OpenApiAuthenticationExtension(OpenApiGeneratorExtension['OpenApiAuthentic
set a higher matching priority by setting the class attribute ``priority = 1`` or higher.
``get_security_definition()`` is expected to return a valid `OpenAPI security scheme object
<https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-scheme-object>`_
<https://spec.openapis.org/oas/v3.0.3#security-scheme-object>`_
"""
_registry: List['OpenApiAuthenticationExtension'] = []

Expand Down Expand Up @@ -51,7 +51,7 @@ class OpenApiSerializerExtension(OpenApiGeneratorExtension['OpenApiSerializerExt
can be accessed via ``self.target``.
``map_serializer()`` is expected to return a valid `OpenAPI schema object
<https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schema-object>`_.
<https://spec.openapis.org/oas/v3.0.3#schema-object>`_.
"""
_registry: List['OpenApiSerializerExtension'] = []

Expand All @@ -74,7 +74,7 @@ class OpenApiSerializerFieldExtension(OpenApiGeneratorExtension['OpenApiSerializ
warnings, in which case manual construction is advisable.
``map_serializer_field()`` is expected to return a valid `OpenAPI schema object
<https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schema-object>`_.
<https://spec.openapis.org/oas/v3.0.3#schema-object>`_.
"""
_registry: List['OpenApiSerializerFieldExtension'] = []

Expand Down Expand Up @@ -119,7 +119,7 @@ class OpenApiFilterExtension(OpenApiGeneratorExtension['OpenApiFilterExtension']
``get_schema_operation_parameters()`` is expected to return either an empty list or a list
of valid raw `OpenAPI parameter objects
<https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#parameterObject>`_.
<https://spec.openapis.org/oas/v3.0.3#parameter-object>`_.
Using ``drf_spectacular.plumbing.build_parameter_type`` is recommended to generate
the appropriate raw dict objects.
"""
Expand Down
4 changes: 2 additions & 2 deletions drf_spectacular/settings.py
Expand Up @@ -158,7 +158,7 @@
'ENABLE_DJANGO_DEPLOY_CHECK': True,

# General schema metadata. Refer to spec for valid inputs
# https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#openapi-object
# https://spec.openapis.org/oas/v3.0.3#openapi-object
'TITLE': '',
'DESCRIPTION': '',
'TOS': None,
Expand Down Expand Up @@ -188,7 +188,7 @@
'EXTENSIONS_ROOT': {},

# Oauth2 related settings. used for example by django-oauth2-toolkit.
# https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#oauth-flows-object
# https://spec.openapis.org/oas/v3.0.3#oauth-flows-object
'OAUTH2_FLOWS': [],
'OAUTH2_AUTHORIZATION_URL': None,
'OAUTH2_TOKEN_URL': None,
Expand Down

0 comments on commit b1c7fd1

Please sign in to comment.