Webargs

Latest version: v8.6.0

Safety actively analyzes 685525 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 18

8.6.0

******************

Bug fixes:

* Fix the handling of invalid JSON bodies in the ``bottle`` parser to support
``bottle`` versions ``>=0.13``.

Other changes:

* ``MultiDictProxy`` now inherits from ``MutableMapping`` rather than ``Mapping``.

8.5.0

******************

Other changes:

* Test against Python 3.12.

* Async location loading now supports loader functions which are not themselves
async, but which return an awaitable result. This means that users who are
already handling awaitable objects can return them from non-async loaders and
expect ``webargs`` to ``await`` them. This allows some async interactions
with supported frameworks, where the ``webargs``-provided parser returns a
framework object and the framework can be set to return awaitables, e.g.,
the Falcon parser. Thanks :user:`j0k2r` for the PR! (:pr:`935`)

8.4.0

******************

Features:

* Add a new class attribute, ``empty_value`` to ``DelimitedList`` and
``DelimitedTuple``, with a default of ``""``.
This controls the value deserialized when an empty string is seen.

``empty_value`` can be used to handle types other than strings more gracefully, e.g.

.. code-block:: python

from webargs import fields


class IntList(fields.DelimitedList):
empty_value = 0


myfield = IntList(fields.Int())

.. note::

``empty_value`` will be changing in webargs v9.0 to be ``missing`` by
default. This will allow use of fields with ``load_default`` to specify
handling of the empty value.

* The rule for default argument names has been made configurable by overriding
the ``get_default_arg_name`` method. This is described in the argument
passing documentation.

Other changes:

* Drop support for Python 3.7, which is EOL.
* Type annotations for ``FlaskParser`` have been improved.

8.3.0

******************

Features:

* ``webargs.Parser`` now inherits from ``typing.Generic`` and is parametrizable
over the type of the request object. Various framework-specific parsers are
parametrized over their relevant request object classes.

* ``webargs.Parser`` and its subclasses now support passing arguments as a
single keyword argument without expanding the parsed data into its
components. For more details, see advanced docs on
``Argument Passing and arg_name``.

Other changes:

* Type annotations have been improved to allow ``Mapping`` for dict-like
schemas where previously ``dict`` was used. This makes the type covariant
rather than invariant (:issue:`836`).

* Test against Python 3.11 (:pr:`787`).

8.2.0

******************

Features:

* A new method, ``webargs.Parser.async_parse``, can be used for async-aware
parsing from the base parser class. This can handle async location loader
functions and async error handlers.

* ``webargs.Parser.use_args`` and ``use_kwargs`` can now be used to decorate
async functions, and will use ``async_parse`` if the decorated function is
also async. They will call the non-async ``parse`` method when used to
decorate non-async functions.

* As a result of the changes to ``webargs.Parser``, ``FlaskParser``,
``DjangoParser``, and ``FalconParser`` now all support async views.
Thanks :user:`Isira-Seneviratne` for the initial PR.

Changes:

* The implementation of ``AsyncParser`` has changed. Now that
``webargs.Parser`` has built-in support for async usage, the primary
purpose of ``AsyncParser`` is to redefine ``parse`` as an alias for
``async_parse``

* Set ``python_requires>=3.7.2`` in package metadata (:pr:`692`).
Thanks :user:`kasium` for the PR.

8.1.0

******************

Bug fixes:

* Fix publishing type hints per `PEP-561 <https://www.python.org/dev/peps/pep-0561/>`_.
(:pr:`650`).
* Add DelimitedTuple to fields.__all__ (:pr:`678`).
* Narrow type of ``argmap`` from ``Mapping`` to ``Dict`` (:pr:`682`).

Other changes:

* Test against Python 3.10 (:pr:`647`).
* Drop support for Python 3.6 (:pr:`673`).
* Address distutils deprecation warning in Python 3.10 (:pr:`652`).
Thanks :user:`kkirsche` for the PR.
* Use postponed evaluation of annotations (:pr:`663`).
Thanks :user:`Isira-Seneviratne` for the PR.
* Pin mypy version in tox (:pr:`674`).
* Improve type annotations for ``__version_info__`` (:pr:`680`).

Page 1 of 18

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.