diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f7637393..b8f5b817 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -788,7 +788,7 @@ Breaking changes: - Parse path parameter type hints from url. closes `#34 `_ - Consolidate duplicate warnings/add error `#28 `_ - Prevent warning for DRF format suffix param -- Improve ACCEPT header handling `#42 `_ +- Improve ACCEPT header handling `#42 `_ Breaking changes: @@ -868,7 +868,7 @@ Breaking changes: - Warn on duplicate serializer names. - Added explicit exclude flag for operation. - Bugfix: PrimaryKeyRelatedField(read_only=True) failing to find type. -- Change operation sorting to alphanumeric with option (`#6 `_) +- Change operation sorting to alphanumeric with option (`#6 `_) - Robustify serializer field support for ``@extend_schema_field``. - Enable field serializers support. [p.g.alekseev] - Adding custom tags support [p.g.alekseev] diff --git a/README.rst b/README.rst index 4b71a4d1..e182baa3 100644 --- a/README.rst +++ b/README.rst @@ -37,7 +37,7 @@ Features - Callback operations (experimental) - Included support for: - `django-polymorphic `_ / `django-rest-polymorphic `_ - - `SimpleJWT `_ + - `SimpleJWT `_ - `DjangoOAuthToolkit `_ - `djangorestframework-jwt `_ (tested fork `drf-jwt `_) - `dj-rest-auth `_ (maintained fork of `django-rest-auth `_) @@ -48,7 +48,7 @@ Features - `djangorestframework-dataclasses `_ -For more information visit the `documentation `_. +For more information visit the `documentation `_. License ------- @@ -288,16 +288,16 @@ globally, and then simply run: $ tox .. _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/ +.. _OpenAPI 3.0: https://spec.openapis.org/oas/v3.0.3 +.. _tox: https://tox.wiki/ .. _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/ .. |pypi-dl| image:: https://img.shields.io/pypi/dm/drf-spectacular diff --git a/docs/client_generation.rst b/docs/client_generation.rst index f793fcfc..5e43057b 100644 --- a/docs/client_generation.rst +++ b/docs/client_generation.rst @@ -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 `_ and -more specifically the `specification proposal `_. +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: diff --git a/docs/conf.py b/docs/conf.py index f22c94f7..6435ef63 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -48,6 +48,20 @@ default_role = 'default-role-error' +linkcheck_allowed_redirects = { + r"^https://tox\.wiki/$": r"https://tox\.wiki/en/latest/$", + r"^https://drf-spectacular\.readthedocs\.io/$": r"https://drf-spectacular\.readthedocs\.io/en/latest/$", + r"^https://docs\.djangoproject\.com/en/stable/": r"^https://docs\.djangoproject\.com/en/\d+\.\d+/", + r"^https://github\.com/tfranzel/drf-spectacular/issues/\d+": "https://github\.com/tfranzel/drf-spectacular/pull/\d+", +} + +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 = [ diff --git a/drf_spectacular/extensions.py b/drf_spectacular/extensions.py index f424ece9..8e4ed150 100644 --- a/drf_spectacular/extensions.py +++ b/drf_spectacular/extensions.py @@ -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 - `_ + `_ """ _registry: List['OpenApiAuthenticationExtension'] = [] @@ -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 - `_. + `_. """ _registry: List['OpenApiSerializerExtension'] = [] @@ -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 - `_. + `_. """ _registry: List['OpenApiSerializerFieldExtension'] = [] @@ -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 - `_. + `_. Using ``drf_spectacular.plumbing.build_parameter_type`` is recommended to generate the appropriate raw dict objects. """ diff --git a/drf_spectacular/plumbing.py b/drf_spectacular/plumbing.py index 64d82f67..4d48c053 100644 --- a/drf_spectacular/plumbing.py +++ b/drf_spectacular/plumbing.py @@ -1058,7 +1058,7 @@ def sanitize_result_object(result): def sanitize_specification_extensions(extensions): - # https://spec.openapis.org/oas/v3.0.3#specification-extensions + # https://spec.openapis.org/oas/v3.0.3#specificationExtensions output = {} for key, value in extensions.items(): if not re.match(r'^x-', key): diff --git a/drf_spectacular/settings.py b/drf_spectacular/settings.py index fd43f53f..848b17cc 100644 --- a/drf_spectacular/settings.py +++ b/drf_spectacular/settings.py @@ -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, @@ -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#oauthFlowsObject 'OAUTH2_FLOWS': [], 'OAUTH2_AUTHORIZATION_URL': None, 'OAUTH2_TOKEN_URL': None,