Changelog
### 7.0.1
```
******************
Bug fixes:
* Fix `DelimitedList` and `DelimitedTuple` to pass additional keyword arguments
through their `_serialize` methods to the child fields and fix type checking
on these classes. (:issue:`569`)
Thanks to :user:`decaz` for reporting.
```
### 7.0.0
```
******************
Changes:
* *Backwards-incompatible*: Drop support for webapp2 (:pr:`565`).
* Add type annotations to `Parser` class, `DelimitedList`, and
`DelimitedTuple`. (:issue:`566`)
```
### 7.0.0b2
```
********************
Features:
* `DjangoParser` now supports the `headers` location. (:issue:`540`)
* `FalconParser` now supports a new `media` location, which uses
Falcon's `media` decoding. (:issue:`253`)
`media` behaves very similarly to the `json` location but also supports any
registered media handler. See the
`Falcon documentation on media types
<https://falcon.readthedocs.io/en/stable/api/media.html>`_ for more details.
Changes:
* `FalconParser` defaults to the `media` location instead of `json`. (:issue:`253`)
* Test against Python 3.9 (:pr:`552`).
* *Backwards-incompatible*: Drop support for Python 3.5 (:pr:`553`).
```
### 7.0.0b1
```
********************
Refactoring:
* *Backwards-incompatible*: Remove support for marshmallow2 (:issue:`539`)
* *Backwards-incompatible*: Remove `dict2schema`
Users desiring the `dict2schema` functionality may now rely upon
`marshmallow.Schema.from_dict`. Rewrite any code using `dict2schema` like so:
.. code-block:: python
import marshmallow as ma
webargs 6.x and older
from webargs import dict2schema
myschema = dict2schema({"q1", ma.fields.Int()})
webargs 7.x
myschema = ma.Schema.from_dict({"q1", ma.fields.Int()})
Features:
* Add ``unknown`` as a parameter to ``Parser.parse``, ``Parser.use_args``,
``Parser.use_kwargs``, and parser instantiation. When set, it will be passed
to ``Schema.load``. When not set, the value passed will depend on the parser's
settings. If set to ``None``, the schema's default behavior will be used (i.e.
no value is passed to ``Schema.load``) and parser settings will be ignored.
This allows usages like
.. code-block:: python
import marshmallow as ma
parser.use_kwargs(
{"q1": ma.fields.Int(), "q2": ma.fields.Int()}, location="query", unknown=ma.EXCLUDE
)
def foo(q1, q2):
...
* Defaults for ``unknown`` may be customized on parser classes via
``Parser.DEFAULT_UNKNOWN_BY_LOCATION``, which maps location names to values
to use.
Usages are varied, but include
.. code-block:: python
import marshmallow as ma
from webargs.flaskparser import FlaskParser
as well as...
class MyParser(FlaskParser):
DEFAULT_UNKNOWN_BY_LOCATION = {"query": ma.INCLUDE}
parser = MyParser()
Setting the ``unknown`` value for a Parser instance has higher precedence. So
.. code-block:: python
parser = MyParser(unknown=ma.RAISE)
will always pass ``RAISE``, even when the location is ``query``.
* By default, webargs will pass ``unknown=EXCLUDE`` for all locations except
for request bodies (``json``, ``form``, and ``json_or_form``) and path
parameters. Request bodies and path parameters will pass ``unknown=RAISE``.
This behavior is defined by the default value for
``DEFAULT_UNKNOWN_BY_LOCATION``.
Changes:
* Registered `error_handler` callbacks are required to raise an exception.
If a handler is invoked and no exception is raised, `webargs` will raise
a `ValueError` (:issue:`527`)
```
Links
- PyPI: https://pypi.org/project/webargs
- Changelog: https://pyup.io/changelogs/webargs/
- Repo: https://github.com/marshmallow-code/webargs
This PR updates webargs from 6.1.1 to 7.0.1.
Changelog
### 7.0.1 ``` ****************** Bug fixes: * Fix `DelimitedList` and `DelimitedTuple` to pass additional keyword arguments through their `_serialize` methods to the child fields and fix type checking on these classes. (:issue:`569`) Thanks to :user:`decaz` for reporting. ``` ### 7.0.0 ``` ****************** Changes: * *Backwards-incompatible*: Drop support for webapp2 (:pr:`565`). * Add type annotations to `Parser` class, `DelimitedList`, and `DelimitedTuple`. (:issue:`566`) ``` ### 7.0.0b2 ``` ******************** Features: * `DjangoParser` now supports the `headers` location. (:issue:`540`) * `FalconParser` now supports a new `media` location, which uses Falcon's `media` decoding. (:issue:`253`) `media` behaves very similarly to the `json` location but also supports any registered media handler. See the `Falcon documentation on media types <https://falcon.readthedocs.io/en/stable/api/media.html>`_ for more details. Changes: * `FalconParser` defaults to the `media` location instead of `json`. (:issue:`253`) * Test against Python 3.9 (:pr:`552`). * *Backwards-incompatible*: Drop support for Python 3.5 (:pr:`553`). ``` ### 7.0.0b1 ``` ******************** Refactoring: * *Backwards-incompatible*: Remove support for marshmallow2 (:issue:`539`) * *Backwards-incompatible*: Remove `dict2schema` Users desiring the `dict2schema` functionality may now rely upon `marshmallow.Schema.from_dict`. Rewrite any code using `dict2schema` like so: .. code-block:: python import marshmallow as ma webargs 6.x and older from webargs import dict2schema myschema = dict2schema({"q1", ma.fields.Int()}) webargs 7.x myschema = ma.Schema.from_dict({"q1", ma.fields.Int()}) Features: * Add ``unknown`` as a parameter to ``Parser.parse``, ``Parser.use_args``, ``Parser.use_kwargs``, and parser instantiation. When set, it will be passed to ``Schema.load``. When not set, the value passed will depend on the parser's settings. If set to ``None``, the schema's default behavior will be used (i.e. no value is passed to ``Schema.load``) and parser settings will be ignored. This allows usages like .. code-block:: python import marshmallow as ma parser.use_kwargs( {"q1": ma.fields.Int(), "q2": ma.fields.Int()}, location="query", unknown=ma.EXCLUDE ) def foo(q1, q2): ... * Defaults for ``unknown`` may be customized on parser classes via ``Parser.DEFAULT_UNKNOWN_BY_LOCATION``, which maps location names to values to use. Usages are varied, but include .. code-block:: python import marshmallow as ma from webargs.flaskparser import FlaskParser as well as... class MyParser(FlaskParser): DEFAULT_UNKNOWN_BY_LOCATION = {"query": ma.INCLUDE} parser = MyParser() Setting the ``unknown`` value for a Parser instance has higher precedence. So .. code-block:: python parser = MyParser(unknown=ma.RAISE) will always pass ``RAISE``, even when the location is ``query``. * By default, webargs will pass ``unknown=EXCLUDE`` for all locations except for request bodies (``json``, ``form``, and ``json_or_form``) and path parameters. Request bodies and path parameters will pass ``unknown=RAISE``. This behavior is defined by the default value for ``DEFAULT_UNKNOWN_BY_LOCATION``. Changes: * Registered `error_handler` callbacks are required to raise an exception. If a handler is invoked and no exception is raised, `webargs` will raise a `ValueError` (:issue:`527`) ```Links
- PyPI: https://pypi.org/project/webargs - Changelog: https://pyup.io/changelogs/webargs/ - Repo: https://github.com/marshmallow-code/webargs