Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix old spelling errors and add a cspell configuration. #796

Merged
merged 3 commits into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 176 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
{
"language": "en",
"ignorePaths": [
"./app.json",
".gitignore",
"*.coverage",
"*.min.js",
"**/__pycache__/**",
"**/*.egg-info/**",
"**/*.git/**",
"**/build/**",
"**/coverage/**",
"**/dist/**",
"**/migrations/**",
"**/swagger-ui-dist/**",
"**/venv/**"
],
"dictionaries": [
"css",
"django",
"fonts",
"local",
"misc",
"python",
"softwareTerms"
],
"words": [
"addopts",
"apiview",
"askar",
"auths",
"authtoken",
"autoclass",
"autodata",
"automodule",
"avenir",
"barebones",
"basepath",
"beaugunderson",
"blueyed",
"builddir",
"bysource",
"cacheable",
"callabale",
"camelize",
"camelized",
"classdoc",
"codecov",
"codegen",
"coreapi",
"coreschema",
"corsheaders",
"coveragerc",
"cristi",
"cristian",
"cschema",
"csrfmiddlewaretoken",
"csrftoken",
"dascalescu",
"datadiff",
"deauth",
"deauthorize",
"deprecated",
"djangorestframework",
"djmaster",
"docstrings",
"documentclass",
"elnappo",
"envlist",
"eryk",
"exitfirst",
"extrahead",
"figwidth",
"filterset",
"formop",
"genindex",
"getdefault",
"ghuser",
"gunicorn",
"herokuapp",
"hirokawa",
"howto",
"htbp",
"htmlhelp",
"immutablehash",
"indentless",
"initkwargs",
"joellefkowitz",
"jsons",
"keepdb",
"keyframeprefix",
"letterpaper",
"levelname",
"linenos",
"maxdepth",
"minversion",
"modindex",
"monokai",
"myparent",
"napierała",
"nbsp",
"noscm",
"npmignore",
"odict",
"omap",
"paginators",
"papersize",
"passwordadmin",
"plugable",
"pointsize",
"popd",
"posargs",
"preauth",
"preauthorize",
"prepended",
"proxied",
"psycopg",
"pushd",
"putenv",
"pythonpath",
"pytz",
"qinsq",
"quickstart",
"rebilly",
"redoc",
"referenceable",
"reftest",
"refuri",
"regexes",
"representer",
"rsichny",
"rtype",
"ruamel",
"scrollbars",
"searchbox",
"serializers",
"setuptools",
"sidemenu",
"sourcedir",
"sphinxbuild",
"sphinxopts",
"sphinxproj",
"staticfiles",
"subclassing",
"swaggerapi",
"tenerowicz",
"testenv",
"testproj",
"therefromhere",
"toctree",
"undoc",
"unencrypted",
"uritemplate",
"urlconf",
"urlconfs",
"urlpatterns",
"versionadded",
"versionchanged",
"versionmodified",
"viewcode",
"viewset",
"viewsets",
"vigrond",
"vschema",
"whitenoise",
"wsgi",
"xdist",
"yasg",
"yasgdoc",
"yetanother",
"yetanothers",
"yourapp",
"yusupov",
"zbyszek"
]
}
4 changes: 2 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ You want to contribute some code? Great! Here are a few steps to get you started

#. **Update documentation**

If the change modifies behaviour or adds new features, you should update the documentation and ``README.rst``
If the change modifies behavior or adds new features, you should update the documentation and ``README.rst``
accordingly. Documentation is written in reStructuredText and built using Sphinx. You can find the sources in the
``docs`` directory.

Expand All @@ -96,7 +96,7 @@ You want to contribute some code? Great! Here are a few steps to get you started
#. **Your code must pass all the required CI jobs before it is merged**

As of now, this consists of running on the supported Python, Django, DRF version matrix (see README),
and building the docs succesfully.
and building the docs successfully.

******************
Maintainer's notes
Expand Down
1 change: 1 addition & 0 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends "!layout.html" %}
{% block extrahead %}
<!-- cspell:disable-next-line -->
<meta name="google-site-verification" content="saewLzcrUS1lAAgNVIikKWc3DUbFcE-TWtpyw3AW8CA" />
{% endblock %}
18 changes: 9 additions & 9 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ and the problems it has caused.
- **IMPROVED:** updated ``swagger-ui`` to version 3.22.0
- **IMPROVED:** updated ``ReDoc`` to version 2.0.0-rc.4
- **FIXED:** ``ListModelMixin`` will now always be treated as a list view (:issue:`306`)
- **FIXED:** non-primtive values in field ``choices`` will now be handled properly (:issue:`340`)
- **FIXED:** non-primitive values in field ``choices`` will now be handled properly (:issue:`340`)

**********
**1.14.0**
Expand Down Expand Up @@ -150,7 +150,7 @@ and the problems it has caused.

- **ADDED:** ``get_security_definitions`` and ``get_security_requirements`` hooks to ``OpenAPISchemaGenerator``
- **ADDED:** added ``get_summary_and_description`` and ``split_summary_from_description`` extension points to
``SwaggerAutoSchema`` to allow for better customisation
``SwaggerAutoSchema`` to allow for better customization
- **IMPROVED:** updated ``swagger-ui`` to version 3.20.4
- **IMPROVED:** paginator ``next`` and ``previous`` fields are now marked as ``x-nullable`` (:issue:`263`)
- **IMPROVED:** added the ``tags`` argument to ``swagger_auto_schema`` (:pr:`259`)
Expand All @@ -161,7 +161,7 @@ and the problems it has caused.
- **FIXED:** fixed handling of lazy objects in user-supplied values
- **FIXED:** ``read_only`` serializer fields will be correctly ignored when generating form parameters (:issue:`261`)
- **FIXED:** fixed incorrect return type from ``UIRenderer`` (:pr:`268`)
- **FIXED:** fixed incosistent ordering of global ``securityDefinitions`` and ``security`` objects
- **FIXED:** fixed inconsistent ordering of global ``securityDefinitions`` and ``security`` objects
- **DEPRECATED:** the ``get_summary`` and ``get_description`` extension points have been deprecated in favor of the
new ``get_summary_and_description``, and will be removed in a future release

Expand All @@ -187,7 +187,7 @@ case). Building without ``.git`` or without ``setuptools-scm`` will result in a
- **FIXED:** ``minLength`` and ``maxLength`` will now also work for ``ListSerializer`` in addition to ``ListField``
- **FIXED:** ``MultipleChoiceField`` will now use the ``multi`` ``collectionFormat`` where appropriate (:issue:`257`)
- **FIXED:** the ``format``, ``pattern``, ``enum``, ``min_length`` and ``max_length`` attributes of
``coreschema.Schema`` will now be persited into the converted ``openapi.Parameter`` (:issue:`212`, :pr:`233`)
``coreschema.Schema`` will now be persisted into the converted ``openapi.Parameter`` (:issue:`212`, :pr:`233`)

**********
**1.11.0**
Expand Down Expand Up @@ -298,7 +298,7 @@ case). Building without ``.git`` or without ``setuptools-scm`` will result in a
- **ADDED:** added ``DEFAULT_GENERATOR_CLASS`` setting and ``--generator-class`` argument to the ``generate_swagger``
management command (:issue:`140`)
- **FIXED:** fixed wrongly required ``'count'`` response field on ``CursorPagination`` (:issue:`141`)
- **FIXED:** fixed some cases where ``swagger_schema_fields`` would not be handlded (:pr:`142`)
- **FIXED:** fixed some cases where ``swagger_schema_fields`` would not be handled (:pr:`142`)
- **FIXED:** fixed crash when encountering ``coreapi.Fields``\ s without a ``schema`` (:issue:`143`)

*********
Expand Down Expand Up @@ -338,7 +338,7 @@ case). Building without ``.git`` or without ``setuptools-scm`` will result in a

*Release date: May 12, 2018*

- **FIXED:** fixed generation of default ``SECURITY_REQUIREMENTS`` to match documented behaviour
- **FIXED:** fixed generation of default ``SECURITY_REQUIREMENTS`` to match documented behavior
- **FIXED:** ordering of ``SECURITY_REQUIREMENTS`` and ``SECURITY_DEFINITIONS`` is now stable

*********
Expand Down Expand Up @@ -548,7 +548,7 @@ case). Building without ``.git`` or without ``setuptools-scm`` will result in a
- **IMPROVED:** removed inline scripts and styles from bundled HTML templates to increase CSP compatibility
- **IMPROVED:** improved validation errors and added more assertion sanity checks (:issue:`37`, :issue:`40`)
- **IMPROVED:** improved handling of NamespaceVersioning by excluding endpoints of differing versions
(i.e. when accesing the schema view for v1, v2 endpoints will not be included in swagger)
(i.e. when accessing the schema view for v1, v2 endpoints will not be included in swagger)

*********
**1.1.3**
Expand Down Expand Up @@ -577,7 +577,7 @@ case). Building without ``.git`` or without ``setuptools-scm`` will result in a

- **ADDED:** :ref:`generate_swagger management command <management-command>`
(:issue:`29`, :pr:`31`, thanks to :ghuser:`beaugunderson`)
- **FIXED:** fixed improper generation of ``\Z`` regex tokens - will now be repalced by ``$``
- **FIXED:** fixed improper generation of ``\Z`` regex tokens - will now be replaced by ``$``

*********
**1.1.0**
Expand All @@ -587,7 +587,7 @@ case). Building without ``.git`` or without ``setuptools-scm`` will result in a

- **ADDED:** added support for APIs versioned with ``URLPathVersioning`` or ``NamespaceVersioning``
- **ADDED:** added ability to recursively customize schema generation
:ref:`using pluggable inspector classes <custom-spec-inspectors>`
:ref:`using plugable inspector classes <custom-spec-inspectors>`
- **ADDED:** added ``operation_id`` parameter to :func:`@swagger_auto_schema <.swagger_auto_schema>`
- **ADDED:** integration with `djangorestframework-camel-case
<https://github.com/vbabiy/djangorestframework-camel-case>`_ (:issue:`28`)
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
# for some reason needs the sources dir to be in the path in order for viewcode to work
sys.path.insert(0, os.path.abspath('../src'))

# activate the Django testproj to be able to succesfully import drf_yasg
# activate the Django testproj to be able to successfully import drf_yasg
sys.path.insert(0, os.path.abspath('../testproj'))
os.putenv('DJANGO_SETTINGS_MODULE', 'testproj.settings.local')

Expand Down
4 changes: 2 additions & 2 deletions docs/custom_spec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ A second example, of a :class:`~.inspectors.FieldInspector` that removes the ``t
- in the output swagger document there is a ``definitions`` section containing :class:`.Schema` objects for all
models
- every usage of a model refers to that single :class:`.Schema` object - for example, in the ArticleViewSet
above, all requests and responses containg an ``Article`` model would refer to the same schema definition by a
above, all requests and responses containing an ``Article`` model would refer to the same schema definition by a
``'$ref': '#/definitions/Article'``

This is implemented by only generating **one** :class:`.Schema` object for every serializer **class** encountered.
Expand All @@ -433,7 +433,7 @@ A second example, of a :class:`~.inspectors.FieldInspector` that removes the ``t
for a given serializer.

**IMPORTANT:** nested fields on ``ModelSerializer``\ s that are generated from model ``ForeignKeys`` will always be
output by value. If you want the by-reference behaviour you have to explictly set the serializer class of nested
output by value. If you want the by-reference behavior you have to explicitly set the serializer class of nested
fields instead of letting ``ModelSerializer`` generate one automatically; for example:

.. code-block:: python
Expand Down
2 changes: 1 addition & 1 deletion docs/custom_ui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The web UI can be customized using the settings available in :ref:`swagger-ui-se
You can also extend one of the `drf-yasg/swagger-ui.html`_ or `drf-yasg/redoc.html`_ templates that are used for
rendering. See the template source code (linked above) for a complete list of customizable blocks.

The ``swagger-ui`` view has some quite involed JavaScript hooks used for some functionality, which you might also
The ``swagger-ui`` view has some quite involved JavaScript hooks used for some functionality, which you might also
want to review at `drf-yasg/swagger-ui-init.js`_.

.. _drf-yasg/swagger-ui.html: https://github.com/axnsan12/drf-yasg/blob/master/src/drf_yasg/templates/drf-yasg/swagger-ui.html
Expand Down
6 changes: 3 additions & 3 deletions docs/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The second step is specifying, for each endpoint, which authentication mechanism
See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#security-requirement-object for details.

By default, a top-level `security` that accepts any one of the declared security definitions is generated.
For the example above, that would be :code:`[{'Basic': []}, {'Bearer': []}]`. This can be overriden using the
For the example above, that would be :code:`[{'Basic': []}, {'Bearer': []}]`. This can be overridden using the
:ref:`SECURITY_REQUIREMENTS <security-definitions-settings>` setting.

Operation-level overrides can be added using the ``security`` parameter of
Expand All @@ -53,15 +53,15 @@ Operation-level overrides can be added using the ``security`` parameter of

It is possible to configure ``swagger-ui`` to authenticate against your (or a third party) OAuth2 service when sending
"Try it out" requests. This client-side configuration does not remove the requirement of a spec-side
:ref:`security definiiton <security-definitions-settings>`, but merely allows you to test OAuth2 APIs using
:ref:`security definition <security-definitions-settings>`, but merely allows you to test OAuth2 APIs using
``swagger-ui`` as a client.

**DISCLAIMER**: this setup is very poorly tested as I do not currently implement OAuth in any of my projects. All
contributions relating to documentation, bugs, mistakes or anything else are welcome as an issue or pull request. The
settings described below were added as a result of discussion in issue :issue:`53`.

The settings of interest can be found on the :ref:`settings page <oauth2-settings>`. Configuration options are similar
to most OAuth client setups like web or mobile applications. Reading the relevant ``swagger-ui`` docmentation linked
to most OAuth client setups like web or mobile applications. Reading the relevant ``swagger-ui`` documentation linked
will also probably help.


Expand Down
10 changes: 5 additions & 5 deletions docs/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ DEFAULT_GENERATOR_CLASS
-------------------------

:class:`~.generators.OpenAPISchemaGenerator` subclass that will be used by default for generating the final
:class:`.Schema` object. Can be overriden by the ``generator_class`` argument to :func:`.get_schema_view`.
:class:`.Schema` object. Can be overridden by the ``generator_class`` argument to :func:`.get_schema_view`.

**Default**: :class:`drf_yasg.generators.OpenAPISchemaGenerator`

DEFAULT_AUTO_SCHEMA_CLASS
-------------------------

:class:`~.inspectors.ViewInspector` subclass that will be used by default for generating :class:`.Operation`
objects when iterating over endpoints. Can be overriden by using the `auto_schema` argument of
objects when iterating over endpoints. Can be overridden by using the `auto_schema` argument of
:func:`@swagger_auto_schema <.swagger_auto_schema>` or by a ``swagger_schema`` attribute on the view class.

**Default**: :class:`drf_yasg.inspectors.SwaggerAutoSchema`
Expand Down Expand Up @@ -207,7 +207,7 @@ See https://github.com/swagger-api/swagger-ui/blob/112bca906553a937ac67adc2e500b
SPEC_URL
--------

URL pointing to a swagger document for use by swagger-ui. The default behaviour is to append ``?format=openapi`` to the
URL pointing to a swagger document for use by swagger-ui. The default behavior is to append ``?format=openapi`` to the
URL which serves the UI; see :ref:`note on URL settings <url-settings>` above.

**Default**: :python:`None` |br|
Expand Down Expand Up @@ -322,7 +322,7 @@ Controls whether operations show the model structure or the example value by def
DEFAULT_MODEL_DEPTH
-------------------

Controls how many levels are expaned by default when showing nested models.
Controls how many levels are expanded by default when showing nested models.

**Default**: :python:`3` |br|
*Maps to parameter*: ``defaultModelExpandDepth``
Expand Down Expand Up @@ -390,7 +390,7 @@ See https://github.com/Rebilly/ReDoc#configuration.
SPEC_URL
--------

URL pointing to a swagger document for use by ReDoc. The default behaviour is to append ``?format=openapi`` to the
URL pointing to a swagger document for use by ReDoc. The default behavior is to append ``?format=openapi`` to the
URL which serves the UI; see :ref:`note on URL settings <url-settings>` above.

**Default**: :python:`None` |br|
Expand Down
Loading