Webargs

Latest version: v8.6.0

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

Scan your dependencies

Page 8 of 18

4.2.0

Not secure
******************

Features:

* Add ``force_all`` argument to ``use_args`` and ``use_kwargs``
(:issue:`252`, :issue:`307`). Thanks :user:`piroux` for reporting.
* *Deprecation*: The ``status_code`` and ``headers`` arguments to ``ValidationError``
are deprecated. Pass ``error_status_code`` and ``error_headers`` to
`Parser.parse`, `Parser.use_args`, and `Parser.use_kwargs` instead.
(:issue:`327`, :issue:`336`).
* Custom error handlers receive ``error_status_code`` and ``error_headers`` arguments.
(:issue:`327`).

.. code-block:: python

<4.2.0
parser.error_handler
def handle_error(error, req, schema):
raise CustomError(error.messages)


class MyParser(FlaskParser):
def handle_error(self, error, req, schema):
...
raise CustomError(error.messages)


>=4.2.0
parser.error_handler
def handle_error(error, req, schema, status_code, headers):
raise CustomError(error.messages)


OR


parser.error_handler
def handle_error(error, **kwargs):
raise CustomError(error.messages)


class MyParser(FlaskParser):
def handle_error(self, error, req, schema, status_code, headers):
...
raise CustomError(error.messages)

OR

def handle_error(self, error, req, **kwargs):
...
raise CustomError(error.messages)

Legacy error handlers will be supported until version 5.0.0.

4.1.3

Not secure
******************

Bug fixes:

* Fix bug in ``AIOHTTParser`` that prevented calling
``use_args`` on the same view function multiple times (:issue:`273`).
Thanks to :user:`dnp1` for reporting and :user:`jangelo` for the fix.
* Fix compatibility with marshmallow 3.0.0rc1 (:pr:`330`).

4.1.2

Not secure
******************

Bug fixes:

* Fix serialization behavior of ``DelimitedList`` (:pr:`319`).
Thanks :user:`lee3164` for the PR.

Other changes:

* Test against Python 3.7.

4.1.1

Not secure
******************

Bug fixes:

* Fix bug in ``AIOHTTPParser`` that caused a ``JSONDecode`` error
when parsing empty payloads (:issue:`229`). Thanks :user:`explosic4`
for reporting and thanks user :user:`kochab` for the PR.

4.1.0

Not secure
******************

Features:

* Add ``webargs.testing`` module, which exposes ``CommonTestCase``
to third-party parser libraries (see comments in :pr:`287`).

4.0.0

Not secure
******************

Features:

* *Backwards-incompatible*: Custom error handlers receive the
`marshmallow.Schema` instance as the third argument. Update any
functions decorated with `Parser.error_handler` to take a ``schema``
argument, like so:

.. code-block:: python

3.x
parser.error_handler
def handle_error(error, req):
raise CustomError(error.messages)


4.x
parser.error_handler
def handle_error(error, req, schema):
raise CustomError(error.messages)


See `marshmallow-code/marshmallow840 (comment) <https://github.com/marshmallow-code/marshmallow/issues/840#issuecomment-403481686>`_
for more information about this change.

Bug fixes:

* *Backwards-incompatible*: Rename ``webargs.async`` to
``webargs.asyncparser`` to fix compatibility with Python 3.7
(:issue:`240`). Thanks :user:`Reskov` for the catch and patch.


Other changes:

* *Backwards-incompatible*: Drop support for Python 3.4 (:pr:`243`). Python 2.7 and
>=3.5 are supported.
* *Backwards-incompatible*: Drop support for marshmallow<2.15.0.
marshmallow>=2.15.0 and >=3.0.0b12 are officially supported.
* Use `black <https://github.com/ambv/black>`_ with `pre-commit <https://pre-commit.com/>`_
for code formatting (:pr:`244`).

Page 8 of 18

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.