1Changelog 2--------- 3 43.14.1 (2021-11-13) 5******************* 6 7Bug fixes: 8 9- Fix publishing type hints per `PEP-561 <https://www.python.org/dev/peps/pep-0561/>`_. 10 Thanks :user:`bwindsor` for the catch and patch. 11 123.14.0 (2021-10-17) 13******************* 14 15Bug fixes: 16 17- Fix ``fields.TimeDelta`` serialization precision (:issue:`1865`). 18 Thanks :user:`yarsanich` for reporting. 19 20Other changes: 21 22- Fix type-hints for ```data``` arg in ```Schema.validate``` to accept 23 list of dictionaries (:issue:`1790`, :pr:`1868`). 24 Thanks :user:`yourun-proger` for PR. 25- Improve warning when passing metadata as keyword arguments (:pr:`1882`). 26 Thanks :user:`traherom` for the PR. 27- Don't build universal wheels. We don't support Python 2 anymore. 28 (:issue:`1860`) Thanks :user:`YKdvd` for reporting. 29- Make the build reproducible (:pr:`1862`). 30- Drop support for Python 3.5 (:pr:`1863`). 31- Test against Python 3.10 (:pr:`1888`). 32 333.13.0 (2021-07-21) 34******************* 35 36Features: 37 38- Replace ``missing``/``default`` field parameters with 39 ``load_default``/``dump_default`` (:pr:`1742`). 40 Thanks :user:`sirosen` for the PR. 41 42Deprecations: 43 44- The use of ``missing``/``default`` field parameters is deprecated and will be 45 removed in marshmallow 4. ``load_default``/``dump_default`` should be used 46 instead. 47 483.12.2 (2021-07-06) 49******************* 50 51Bug fixes: 52 53- Don't expose ``Field``\s as ``Schema`` attributes. This reverts a change 54 introduced in 3.12.0 that causes issues when field names conflict with 55 ``Schema`` attributes or methods. ``Fields``\s are still accessible on a 56 ``Schema`` instance throught the ``fields`` attribute. (:pr:`1843`) 57 583.12.1 (2021-05-10) 59******************* 60 61Bug fixes: 62 63- Fix bug that raised an ``AttributeError`` when instantiating a 64 ``Schema`` with a field named ``parent`` (:issue:`1808`). 65 Thanks :user:`flying-sheep` for reporting and helping with the fix. 66 673.12.0 (2021-05-09) 68******************* 69 70Features: 71 72- Add ``validate.And`` (:issue:`1768`). 73 Thanks :user:`rugleb` for the suggestion. 74- Add type annotations to ``marshmallow.decorators`` (:issue:`1788`, :pr:`1789`). 75 Thanks :user:`michaeldimchuk` for the PR. 76- Let ``Field``\s be accessed by name as ``Schema`` attributes (:pr:`1631`). 77 78Other changes: 79 80- Improve types in ``marshmallow.validate`` (:pr:`1786`). 81- Make ``marshmallow.validate.Validator`` an abstract base class (:pr:`1786`). 82- Remove unnecessary list cast (:pr:`1785`). 83 843.11.1 (2021-03-29) 85******************* 86 87Bug fixes: 88 89- Fix treatment of dotted keys when ``unknown=INCLUDE`` (:issue:`1506`). 90 Thanks :user:`rbu` for reporting and thanks :user:`sirosen` for the fix (:pr:`1745`). 91 923.11.0 (2021-03-28) 93******************* 94 95Features: 96 97- Add ``fields.IPInterface``, ``fields.IPv4Interface``, and 98 ``IPv6Interface`` (:issue:`1733`). Thanks :user:`madeinoz67` 99 for the suggestion and the PR. 100- Raise ``AttributeError`` for missing methods when using ``fields.Method`` (:pr:`1675`). 101 Thanks :user:`lassandroan`. 102 103Other changes: 104 105- Remove unnecessary ``hasattr`` and ``getattr`` checks in ``Field`` (:pr:`1770`). 106 1073.10.0 (2020-12-19) 108******************* 109 110Deprecations: 111 112- Passing field metadata via keyword arguments is deprecated and will be 113 removed in marshmallow 4 (:issue:`1350`). Use the explicit ``metadata=...`` 114 argument instead. Thanks :user:`sirosen`. 115 1163.9.1 (2020-11-07) 117****************** 118 119Bug fixes: 120 121- Cast to mapping type in ``Mapping.serialize`` and ``Mapping.deserialize`` 122 (:pr:`1685`). 123- Fix bug letting ``Dict`` pass invalid dict on deserialization when no key or 124 value ``Field`` is specified (:pr:`1685`). 125 1263.9.0 (2020-10-31) 127****************** 128 129Features: 130 131- Add ``format`` argument to ``fields.Time`` and ``timeformat`` ``class Meta`` option (:issue:`686`). 132 Thanks :user:`BennyAlex` for the suggestion and thanks :user:`infinityxxx` for the PR. 133 134Other changes: 135 136- Remove usage of implicit ``typing.Optional`` (:issue:`1663`). 137 Thanks :user:`nadega` for the PR. 138 1393.8.0 (2020-09-16) 140****************** 141 142Features: 143 144- Add ``fields.IP``, ``fields.IPv4`` and ``fields.IPv6`` (:pr:`1485`). Thanks 145 :user:`mgetka` for the PR. 146 147Bug fixes: 148 149- Fix typing in ``AwareDateTime`` (:pr:`1658`). Thanks :user:`adithyabsk` for 150 reporting. 151 1523.7.1 (2020-07-20) 153****************** 154 155Bug fixes: 156 157- ``fields.Boolean`` correctly serializes non-hashable types (:pr:`1633`). 158 Thanks :user:`jun0jang` for the PR. 159 1603.7.0 (2020-07-08) 161****************** 162 163Deprecations: 164 165- ``marshmallow.pprint`` is deprecated and will be removed in marshmallow 4 (:issue:`1588`). 166 167Support: 168 169- Document ``default_error_messages`` on field classes (:pr:`1619`). Thanks :user:`weeix`. 170 171Bug fixes: 172 173- Fix passing ``only`` and ``exclude`` to ``Nested`` with an ordered ``Schema`` (:pr:`1627`). 174 Thanks :user:`juannorris` for the PR. 175 1763.6.1 (2020-06-02) 177****************** 178 179No code changes--only docs and contributor-facing updates in this release. 180 181Support: 182 183- Documentation: improve custom fields example (:issue:`1538`). 184 Thanks :user:`pablospizzamiglio` for reporting the problem with the 185 old example and thanks :user:`Resinderate` for the PR. 186- Documentation: Split up API reference into multiple pages and 187 add summary tables (:pr:`1587`). Thanks :user:`EpicWink` for the PR. 188 1893.6.0 (2020-05-08) 190****************** 191 192Features: 193 194- Add ``validate.ContainsNoneOf`` (:issue:`1528`). 195 Thanks :user:`Resinderate` for the suggestion and the PR. 196 197 1983.5.2 (2020-04-30) 199****************** 200 201Bug fixes: 202 203- Fix typing in ``class_registry`` (:pr:`1574`). Thanks :user:`mahenzon`. 204 2053.5.1 (2020-03-05) 206****************** 207 208Bug fixes: 209 210- Includes bug fix from 2.21.0. 211 2123.5.0 (2020-02-19) 213****************** 214 215Bug fixes: 216 217- Fix list of nullable nested fields ``List(Nested(Field, allow_none=True)`` 218 (:issue:`1497`). Because this fix reverts an optimization introduced to 219 speed-up serialization and deserialization of lists of nested fields, a 220 negative impact on performance in this specific case is expected. 221 2223.4.0 (2020-02-02) 223****************** 224 225Features: 226 227- Improve type coverage (:issue:`1479`). Thanks :user:`Reskov`. 228 229Bug fixes: 230 231- Fix typing for ``data`` param of ``Schema.load`` and ``ValidationError`` (:issue:`1492`). 232 Thanks :user:`mehdigmira` for reporting and thanks :user:`dfirst` for the PR. 233 234Other changes: 235 236- Remove unnecessary typecasts (:pr:`1500`). Thanks :user:`hukkinj1`. 237- Remove useless ``_serialize`` override in ``UUID`` field (:pr:`1489`). 238 2393.3.0 (2019-12-05) 240****************** 241 242Features: 243 244- ``fields.Nested`` may take a callable that returns a schema instance. 245 Use this to resolve order-of-declaration issues when schemas nest each other (:issue:`1146`). 246 247.. code-block:: python 248 249 # <3.3 250 class AlbumSchema(Schema): 251 title = fields.Str() 252 artist = fields.Nested("ArtistSchema", only=("name",)) 253 254 255 class ArtistSchema(Schema): 256 name = fields.Str() 257 albums = fields.List(fields.Nested(AlbumSchema)) 258 259 260 # >=3.3 261 class AlbumSchema(Schema): 262 title = fields.Str() 263 artist = fields.Nested(lambda: ArtistSchema(only=("name",))) 264 265 266 class ArtistSchema(Schema): 267 name = fields.Str() 268 albums = fields.List(fields.Nested(AlbumSchema)) 269 270Deprecations: 271 272- Passing the string ``"self"`` to ``fields.Nested`` is deprecated. 273 Use a callable instead. 274 275.. code-block:: python 276 277 from marshmallow import Schema, fields 278 279 # <3.3 280 class PersonSchema(Schema): 281 partner = fields.Nested("self", exclude=("partner",)) 282 friends = fields.List(fields.Nested("self")) 283 284 285 # >=3.3 286 class PersonSchema(Schema): 287 partner = fields.Nested(lambda: PersonSchema(exclude=("partner"))) 288 friends = fields.List(fields.Nested(lambda: PersonSchema())) 289 290Other changes: 291 292- Fix typing for ``Number._format_num`` (:pr:`1466`). Thanks :user:`hukkinj1`. 293- Make mypy stricter and remove dead code (:pr:`1467`). Thanks again, :user:`hukkinj1`. 294 2953.2.2 (2019-11-04) 296****************** 297 298Bug fixes: 299 300- Don't load fields for which ``load_only`` and ``dump_only`` are both ``True`` (:pr:`1448`). 301- Fix types in ``marshmallow.validate`` (:pr:`1446`). 302 303Support: 304 305- Test against Python 3.8 (:pr:`1431`). 306 3073.2.1 (2019-09-30) 308++++++++++++++++++ 309 310Bug fixes: 311 312- Fix typing for ``Schema.dump[s]`` (:pr:`1416`). 313 3143.2.0 (2019-09-17) 315++++++++++++++++++ 316 317Features: 318 319- Add type annotations to ``marshmallow.schema`` and ``marshmallow.validate`` (:pr:`1407`, :issue:`663`). 320 321Bug fixes: 322 323- Fix compatibility with Python < 3.5.3 (:issue:`1409`). Thanks :user:`lukaszdudek-silvair` for reporting. 324 325Refactoring: 326 327- Remove unnecessary ``BaseSchema`` superclass (:pr:`1406`). 328 3293.1.1 (2019-09-16) 330++++++++++++++++++ 331 332Bug fixes: 333 334- Restore inheritance hierarchy of ``Number`` fields (:pr:`1403`). 335 ``fields.Integer`` and ``fields.Decimal`` inherit from ``fields.Number``. 336- Fix bug that raised an uncaught error when a nested schema instance had an unpickleable object in its context (:issue:`1404`). 337 Thanks :user:`metheoryt` for reporting. 338 3393.1.0 (2019-09-15) 340++++++++++++++++++ 341 342Features: 343 344- Add more type annotations (:issue:`663`). 345 Type information is distributed per `PEP 561 <https://www.python.org/dev/peps/pep-0561/>`_ . 346 Thanks :user:`fuhrysteve` for helping with this. 347 348Bug fixes: 349 350- Includes bug fix from 2.20.5. 351 3523.0.5 (2019-09-12) 353++++++++++++++++++ 354 355Bug fixes: 356 357- Fix bug that raised an uncaught error when passing both a schema instance and ``only`` to ``Nested`` (:pr:`1395`). 358 This bug also affected passing a schema instance to ``fields.Pluck``. 359 360 3613.0.4 (2019-09-11) 362++++++++++++++++++ 363 364Bug fixes: 365 366- Fix propagating dot-delimited ``only`` and ``exclude`` parameters to nested schema instances (:issue:`1384`). 367- Includes bug fix from 2.20.4 (:issue:`1160`). 368 3693.0.3 (2019-09-04) 370++++++++++++++++++ 371 372Bug fixes: 373 374- Handle when ``data_key`` is an empty string (:issue:`1378`). 375 Thanks :user:`jtrakk` for reporting. 376 3773.0.2 (2019-09-04) 378++++++++++++++++++ 379 380Bug fixes: 381 382- Includes bug fix from 2.20.3 (:pr:`1376`). 383- Fix incorrect ``super()`` call in ``SchemaMeta.__init__`` (:pr:`1362`). 384 3853.0.1 (2019-08-21) 386++++++++++++++++++ 387 388Bug fixes: 389 390- Fix bug when nesting ``fields.DateTime`` within ``fields.List`` or ``fields.Tuple`` (:issue:`1357`). 391 This bug was introduced in 3.0.0rc9. Thanks :user:`zblz` for reporting. 392 3933.0.0 (2019-08-18) 394++++++++++++++++++ 395 396Features: 397 398- Optimize ``List(Nested(...))`` (:issue:`779`). 399- Minor performance improvements and cleanup (:pr:`1328`). 400- Add ``Schema.from_dict`` (:issue:`1312`). 401 402Deprecations/Removals: 403 404- ``Field.fail`` is deprecated. Use ``Field.make_error`` instead. 405- Remove UUID validation from ``fields.UUID``, for consistency with other fields (:issue:`1132`). 406 407Support: 408 409- Various docs improvements (:pr:`1329`). 410 4113.0.0rc9 (2019-07-31) 412+++++++++++++++++++++ 413 414Features: 415 416- *Backwards-incompatible*: Validation does not occur on serialization (:issue:`1132`). 417 This significantly improves serialization performance. 418- *Backwards-incompatible*: ``DateTime`` does not affect timezone information 419 on serialization and deserialization (:issue:`1234`, :pr:`1278`). 420- Add ``NaiveDateTime`` and ``AwareDateTime`` to enforce timezone awareness 421 (:issue:`1234`, :pr:`1287`). 422- *Backwards-incompatible*: ``List`` does not wrap single values in a list on 423 serialization (:pr:`1307`). 424- *Backwards-incompatible*: ``Schema.handle_error`` receives ``many`` and ``partial`` as keyword arguments (:pr:`1321`). 425- Use ``raise from`` more uniformly to improve stack traces (:pr:`1313`). 426- Rename ``Nested.__schema`` to ``Nested._schema`` to prevent name mangling (:issue:`1289`). 427- Performance improvements (:pr:`1309`). 428 429Deprecations/Removals: 430 431- ``LocalDateTime`` is removed (:issue:`1234`). 432- ``marshmallow.utils.utc`` is removed. Use ``datetime.timezone.utc`` instead. 433 434Bug fixes: 435 436- Fix behavior of ``List(Nested("self"))`` (`#779 (comment) <https://github.com/marshmallow-code/marshmallow/issues/779#issuecomment-396354987>`_). 437 438Support: 439 440- Document usage of ``validate.Regexp``'s usage ``re.search`` (:issue:`1285`). Thanks :user:`macdonaldezra`. 441 4423.0.0rc8 (2019-07-04) 443+++++++++++++++++++++ 444 445Features: 446 447- Propagate ``only`` and ``exclude`` parameters to ``Nested`` fields 448 within ``List`` and ``Dict`` (:issue:`779`, :issue:`946`). 449- Use ``email.utils.parsedate_to_datetime`` instead of conditionally 450 using dateutil for parsing RFC dates (:pr:`1246`). 451- Use internal util functions instead of conditionally using dateutil 452 for parsing ISO 8601 datetimes, dates and times. Timezone info is now 453 correctly deserialized whether or not dateutil is installed. (:pr:`1265`) 454- Improve error messages for ``validate.Range``. 455- Use ``raise from error`` for better stack traces (:pr:`1254`). Thanks 456 :user:`fuhrysteve`. 457- python-dateutil is no longer used. This resolves the inconsistent behavior 458 based on the presence of python-dateutil (:issue:`497`, :issue:`1234`). 459 460Bug fixes: 461 462- Fix method resolution for ``__init__`` method of ``fields.Email`` and 463 ``fields.URL`` (:issue:`1268`). Thanks :user:`dursk` for the catch and patch. 464- Includes bug fixes from 2.19.4 and 2.19.5. 465 466Other changes: 467 468- *Backwards-incompatible*: Rename ``fields.List.container`` to ``fields.List.inner``, 469 ``fields.Dict.key_container`` to ``fields.Dict.key_field``, and 470 ``fields.Dict.value_container`` to ``fields.Dict.value_field``. 471- Switch to Azure Pipelines for CI (:issue:`1261`). 472 4733.0.0rc7 (2019-06-15) 474+++++++++++++++++++++ 475 476Features: 477 478- *Backwards-incompatible*: ``many`` is passed as a keyword argument to methods decorated with 479 ``pre_load``, ``post_load``, ``pre_dump``, ``post_dump``, 480 and ``validates_schema``. ``partial`` is passed as a keyword argument to 481 methods decorated with ``pre_load``, ``post_load`` and ``validates_schema``. 482 ``**kwargs`` should be added to all decorated methods. 483- Add ``min_inclusive`` and ``max_exclusive`` parameters to 484 ``validate.Range`` (:issue:`1221`). Thanks :user:`kdop` for the PR. 485 486Bug fixes: 487 488- Fix propagation of ``partial`` to ``Nested`` containers (part of :issue:`779`). 489- Includes bug fix from 2.19.3. 490 491Other changes: 492 493- *Backwards-incompatible*: Use keyword-only arguments (:issue:`1216`). 494 4953.0.0rc6 (2019-05-05) 496+++++++++++++++++++++ 497 498Support: 499 500- *Backwards-incompatible*: Remove support for Python 2 (:issue:`1120`). 501 Only Python>=3.5 is supported. 502 Thank you :user:`rooterkyberian` for the suggestion and the PR. 503- *Backwards-incompatible*: Remove special-casing in ``fields.List`` and 504 ``fields.Tuple`` for accessing nested attributes (:pr:`1188`). 505 Use ``fields.List(fields.Pluck(...))`` instead. 506- Add ``python_requires`` to ``setup.py`` (:pr:`1194`). 507 Thanks :user:`hugovk`. 508- Upgrade syntax with ``pyupgrade`` in pre-commit (:pr:`1195`). Thanks 509 again :user:`hugovk`. 510 5113.0.0rc5 (2019-03-30) 512+++++++++++++++++++++ 513 514Features: 515 516- Allow input value to be included in error messages 517 for a number of fields (:pr:`1129`). Thanks :user:`hdoupe` for the PR. 518- Improve default error messages for ``OneOf`` and ``ContainsOnly`` 519 (:issue:`885`). Thanks :user:`mcgfeller` for the suggestion 520 and :user:`maxalbert` for the PR. 521 522Deprecations/Removals: 523 524- Remove ``fields.FormattedString`` (:issue:`1141`). Use 525 ``fields.Function`` or ``fields.Method`` instead. 526 527Bug fixes: 528 529- Includes bug fix from 2.19.2. 530 5313.0.0rc4 (2019-02-08) 532+++++++++++++++++++++ 533 534Features: 535 536- Add ``fields.Tuple`` (:issue:`1103`) Thanks :user:`zblz` for the PR. 537- Add ``fields.Mapping``, which makes it easier to support other 538 mapping types (e.g. ``OrderedDict``) (:issue:`1092`). 539 Thank :user:`sayanarijit` for the suggestion and the PR. 540 5413.0.0rc3 (2019-01-13) 542+++++++++++++++++++++ 543 544Features: 545 546- Make the error messages for "unknown fields" and "invalid data type" 547 configurable (:issue:`852`). Thanks :user:`Dunstrom` for the PR. 548- ``fields.Boolean`` parses ``"yes"``/``"no"`` values (:pr:`1081`). 549 Thanks :user:`r1b`. 550 551Other changes: 552 553- *Backwards-incompatible with previous 3.x versions*: Change ordering 554 of ``keys`` and ``values`` arguments to ``fields.Dict``. 555- Remove unused code in ``marshmallow.utils``: ``is_indexable_but_not_string``, 556 ``float_to_decimal``, ``decimal_to_fixed``, ``from_iso`` (:pr:`1088`). 557- Remove unused ``marshmallow.compat.string_types``. 558 559Bug fixes: 560 561- Includes bug fix from 2.18.0. 562 5633.0.0rc2 (2019-01-03) 564+++++++++++++++++++++ 565 566Features: 567 568- Add ``register`` *class Meta* option to allow bypassing marshmallow's 569 internal class registry when memory usage is critical (:issue:`660`). 570 571Bug fixes: 572 573- Fix serializing dict-like objects with properties (:issue:`1060`). 574 Thanks :user:`taion` for the fix. 575- Fix populating ``ValidationError.valid_data`` for ``List`` and 576 ``Dict`` fields (:issue:`766`). 577 578Other changes: 579 580- Add ``marshmallow.__version_info__`` (:pr:`1074`). 581- Remove the ``marshmallow.marshalling`` internal module (:pr:`1070`). 582- A ``ValueError`` is raised when the ``missing`` parameter is passed 583 for required fields (:issue:`1040`). 584- Extra keyword arguments passed to ``ValidationError`` in validators 585 are no longer passed to the final ``ValidationError`` raised upon 586 validation completion (:issue:`996`). 587 5883.0.0rc1 (2018-11-29) 589+++++++++++++++++++++ 590 591Features: 592 593- *Backwards-incompatible*: Rework ``ValidationError`` API. 594 It now expects a single field name, and error structures are merged 595 in the final ``ValidationError`` raised when validation completes. 596 This allows schema-level validators to raise errors for individual 597 fields (:issue:`441`). Thanks :user:`maximkulkin` for 598 writing the original ``merge_errors`` implementation in :pr:`442` and thanks 599 :user:`lafrech` for completing the implementation in :pr:`1026`. 600 601Bug fixes: 602 603- Fix ``TypeError`` when serializing ``None`` with ``Pluck`` (:pr:`1049`). 604 Thanks :user:`toffan` for the catch and patch. 605 6063.0.0b20 (2018-11-01) 607+++++++++++++++++++++ 608 609Bug fixes: 610 611- Includes bug fixes from 2.16.2 and 2.16.3. 612 6133.0.0b19 (2018-10-24) 614+++++++++++++++++++++ 615 616Features: 617 618- Support partial loading of nested fields (:pr:`438`). Thanks 619 :user:`arbor-dwatson` for the PR. *Note*: Subclasses of ``fields.Nested`` 620 now take an additional ``partial`` parameter in the ``_deserialize`` 621 method. 622 623Bug fixes: 624 625- Restore ``Schema.TYPE_MAPPING``, which was removed in 3.0.0b17 (:issue:`1012`). 626 627Other changes: 628 629- *Backwards-incompatible*: ``_serialize`` and ``_deserialize`` methods of 630all ``fields.Field`` subclasses must accept ``**kwargs`` (:pr:`1007`). 631 632 6333.0.0b18 (2018-10-15) 634+++++++++++++++++++++ 635 636Bug fixes: 637 638- Fix ``Date`` deserialization when using custom format (:issue:`1001`). Thanks 639 :user:`Ondkloss` for reporting. 640 641Deprecations/Removals: 642 643- ``prefix`` parameter or ``Schema`` class is removed (:issue:`991`). The same 644 can be achieved using a ``@post_dump`` method. 645 646 6473.0.0b17 (2018-10-13) 648+++++++++++++++++++++ 649 650Features: 651 652- Add ``format`` option to ``Date`` field (:pr:`869`). 653- *Backwards-incompatible*: Rename ``DateTime``'s ``dateformat`` Meta option 654 to ``datetimeformat``. ``dateformat`` now applies to ``Date`` (:pr:`869`). 655 Thanks :user:`knagra` for implementing these changes. 656- Enforce ISO 8601 when deserializing date and time (:issue:`899`). 657 Thanks :user:`dushr` for the report and the work on the PR. 658- *Backwards-incompatible*: Raise ``ValueError`` on ``Schema`` instantiation in 659 case of ``attribute`` or ``data_key`` collision (:pr:`992`). 660 661Bug fixes: 662 663- Fix inconsistencies in field inference by refactoring the inference feature 664 into a dedicated field (:issue:`809`). Thanks :user:`taion` for the PR. 665- When ``unknown`` is not passed to ``Nested``, default to nested ``Schema`` 666 ``unknown`` meta option rather than ``RAISE`` (:pr:`963`). 667 Thanks :user:`vgavro` for the PR. 668- Fix loading behavior of ``fields.Pluck`` (:pr:`990`). 669- Includes bug fix from 2.16.0. 670 6713.0.0b16 (2018-09-20) 672+++++++++++++++++++++ 673 674Bug fixes: 675 676- Fix ``root`` attribute for nested container fields 677 on inheriting schemas (:issue:`956`). Thanks :user:`bmcbu` 678 for reporting. 679 6803.0.0b15 (2018-09-18) 681+++++++++++++++++++++ 682 683Bug fixes: 684 685- Raise ``ValidationError`` instead of ``TypeError`` when non-iterable types are 686 validated with ``many=True`` (:issue:`851`). 687- ``many=True`` no longer iterates over ``str`` and ``collections.abc.Mapping`` objects and instead 688 raises a ``ValidationError`` with ``{'_schema': ['Invalid input type.']}`` (:issue:`930`). 689- Return ``[]`` as ``ValidationError.valid_data`` instead of ``{}`` when 690 ``many=True`` (:issue:`907`). 691 692Thanks :user:`tuukkamustonen` for implementing these changes. 693 6943.0.0b14 (2018-09-15) 695+++++++++++++++++++++ 696 697Features: 698 699- Add ``fields.Pluck`` for serializing a single field from a nested object 700 (:issue:`800`). Thanks :user:`timc13` for the feedback and :user:`deckar01` 701 for the implementation. 702- *Backwards-incompatible*: Passing a string argument as ``only`` to 703 ``fields.Nested`` is no longer supported. Use ``fields.Pluck`` instead 704 (:issue:`800`). 705- Raise a ``StringNotCollectionError`` if ``only`` or ``exclude`` is 706 passed as a string to ``fields.Nested`` (:pr:`931`). 707- *Backwards-incompatible*: ``Float`` takes an ``allow_nan`` parameter to 708 explicitly allow serializing and deserializing special values (``nan``, 709 ``inf`` and ``-inf``). ``allow_nan`` defaults to ``False``. 710 711Other changes: 712 713- *Backwards-incompatible*: ``Nested`` field now defaults to ``unknown=RAISE`` 714 instead of ``EXCLUDE``. This harmonizes behavior with ``Schema`` that 715 already defaults to ``RAISE`` (:issue:`908`). Thanks :user:`tuukkamustonen`. 716- Tested against Python 3.7. 717 7183.0.0b13 (2018-08-04) 719+++++++++++++++++++++ 720 721Bug fixes: 722 723- Errors reported by a schema-level validator for a field in a ``Nested`` field 724 are stored under corresponding field name, not ``_schema`` key (:pr:`862`). 725- Includes bug fix from 2.15.4. 726 727Other changes: 728 729- *Backwards-incompatible*: The ``unknown`` option now defaults to ``RAISE`` 730 (`#524 (comment) <https://github.com/marshmallow-code/marshmallow/issues/524#issuecomment-397165731>`_, 731 :issue:`851`). 732- *Backwards-incompatible*: When a schema error is raised with a ``dict`` as 733 payload, the ``dict`` overwrites any existing error list. Before this change, 734 it would be appended to the list. 735- Raise a `StringNotCollectionError` if ``only`` or ``exclude`` is 736 passed as a string (:issue:`316`). Thanks :user:`paulocheque` for 737 reporting. 738 7393.0.0b12 (2018-07-04) 740+++++++++++++++++++++ 741 742Features: 743 744- The behavior to apply when encountering unknown fields while deserializing 745 can be controlled with the ``unknown`` option (:issue:`524`, 746 :issue:`747`, :issue:`127`). 747 It makes it possible to either "include", "exclude", or "raise". 748 Thanks :user:`tuukkamustonen` for the suggestion and thanks 749 :user:`ramnes` for the PR. 750 751.. warning:: 752 753 The default for ``unknown`` will be changed to ``RAISE`` in the 754 next release. 755 756Other changes: 757 758- *Backwards-incompatible*: Pre/Post-processors MUST return modified data. 759 Returning ``None`` does not imply data were mutated (:issue:`347`). Thanks 760 :user:`tdevelioglu` for reporting. 761- *Backwards-incompatible*: ``only`` and ``exclude`` are bound by 762 declared and additional fields. A ``ValueError`` is raised if invalid 763 fields are passed (:issue:`636`). Thanks :user:`jan-23` for reporting. 764 Thanks :user:`ikilledthecat` and :user:`deckar01` for the PRs. 765- Format code using pre-commit (:pr:`855`). 766 767Deprecations/Removals: 768 769- ``ValidationError.fields`` is removed (:issue:`840`). Access field 770 instances from ``Schema.fields``. 771 7723.0.0b11 (2018-05-20) 773+++++++++++++++++++++ 774 775Features: 776 777- Clean up code for schema hooks (:pr:`814`). Thanks :user:`taion`. 778- Minor performance improvement from simplifying ``utils.get_value`` (:pr:`811`). Thanks again :user:`taion`. 779- Add ``require_tld`` argument to ``fields.URL`` (:issue:`749`). Thanks 780 :user:`DenerKup` for reporting and thanks :user:`surik00` for the PR. 781- ``fields.UUID`` deserializes ``bytes`` strings using ``UUID(bytes=b'...')`` (:pr:`625`). 782 Thanks :user:`JeffBerger` for the suggestion and the PR. 783 784Bug fixes: 785 786- Fields nested within ``Dict`` correctly inherit context from their 787 parent schema (:issue:`820`). Thanks :user:`RosanneZe` for reporting 788 and :user:`deckar01` for the PR. 789- Includes bug fix from 2.15.3. 790 791 7923.0.0b10 (2018-05-10) 793+++++++++++++++++++++ 794 795Bug fixes: 796 797- Includes bugfixes from 2.15.2. 798 7993.0.0b9 (2018-04-25) 800++++++++++++++++++++ 801 802Features: 803 804- *Backwards-incompatible*: ``missing`` and ``default`` values are 805 passed in deserialized form (:issue:`378`). Thanks :user:`chadrik` for 806 the suggestion and thanks :user:`lafrech` for the PR. 807 808Bug fixes: 809 810- Includes the bugfix from 2.15.1. 811 8123.0.0b8 (2018-03-24) 813++++++++++++++++++++ 814 815Features: 816 817- *Backwards-incompatible*: Add ``data_key`` parameter to fields for 818 specifying the key in the input and output data dict. This 819 parameter replaces both ``load_from`` and ``dump_to`` (:issue:`717`). 820 Thanks :user:`lafrech`. 821- *Backwards-incompatible*: When ``pass_original=True`` is passed to one 822 of the decorators and a collection is being (de)serialized, the 823 ``original_data`` argument will be a single object unless 824 ``pass_many=True`` is also passed to the decorator (:issue:`315`, 825 :issue:`743`). Thanks :user:`stj` for the PR. 826- *Backwards-incompatible*: Don't recursively check nested required 827 fields when the ``Nested`` field's key is missing (:issue:`319`). This 828 reverts :pr:`235`. Thanks :user:`chekunkov` reporting and thanks 829 :user:`lafrech` for the PR. 830- *Backwards-incompatible*: Change error message collection for ``Dict`` field (:issue:`730`). Note: 831 this is backwards-incompatible with previous 3.0.0bX versions. 832 Thanks :user:`shabble` for the report and thanks :user:`lafrech` for the PR. 833 8343.0.0b7 (2018-02-03) 835++++++++++++++++++++ 836 837Features: 838 839- *Backwards-incompatible*: Schemas are always strict (:issue:`377`). 840 The ``strict`` parameter is removed. 841- *Backwards-incompatible*: ``Schema().load`` and ``Schema().dump`` return ``data`` instead of a 842 ``(data, errors)`` tuple (:issue:`598`). 843- *Backwards-incomaptible*: ``Schema().load(None)`` raises a 844 ``ValidationError`` (:issue:`511`). 845 846See :ref:`upgrading_3_0` for a guide on updating your code. 847 848Thanks :user:`lafrech` for implementing these changes. 849Special thanks to :user:`MichalKononenko`, :user:`douglas-treadwell`, and 850:user:`maximkulkin` for the discussions on these changes. 851 852 853Other changes: 854 855- *Backwards-incompatible*: Field name is not checked when ``load_from`` 856 is specified (:pr:`714`). Thanks :user:`lafrech`. 857 858Support: 859 860- Add `Code of Conduct <https://marshmallow.readthedocs.io/en/dev/code_of_conduct.html>`_. 861 862 8633.0.0b6 (2018-01-02) 864++++++++++++++++++++ 865 866Bug fixes: 867 868- Fixes ``ValidationError.valid_data`` when a nested field contains errors 869 (:issue:`710`). This bug was introduced in 3.0.0b3. Thanks 870 :user:`lafrech`. 871 872Other changes: 873 874- *Backwards-incompatible*: ``Email`` and ``URL`` fields don't validate 875 on serialization (:issue:`608`). This makes them more consistent with the other 876 fields and improves serialization performance. Thanks again :user:`lafrech`. 877- ``validate.URL`` requires square brackets around IPv6 URLs (:issue:`707`). Thanks :user:`harlov`. 878 8793.0.0b5 (2017-12-30) 880++++++++++++++++++++ 881 882Features: 883 884- Add support for structured dictionaries by providing values and keys arguments to the 885 ``Dict`` field's constructor. This mirrors the ``List`` 886 field's ability to validate its items (:issue:`483`). Thanks :user:`deckar01`. 887 888Other changes: 889 890- *Backwards-incompatible*: ``utils.from_iso`` is deprecated in favor of 891 ``utils.from_iso_datetime`` (:issue:`694`). Thanks :user:`sklarsa`. 892 8933.0.0b4 (2017-10-23) 894++++++++++++++++++++ 895 896Features: 897 898- Add support for millisecond, minute, hour, and week precisions to 899 ``fields.TimeDelta`` (:issue:`537`). Thanks :user:`Fedalto` for the 900 suggestion and the PR. 901- Includes features from release 2.14.0. 902 903 904Support: 905 906- Copyright year in docs uses ``CHANGELOG.rst``'s modified date for 907 reproducible builds (:issue:`679`). Thanks :user:`bmwiedemann`. 908- Test against Python 3.6 in tox. Thanks :user:`Fedalto`. 909- Fix typo in exception message (:issue:`659`). Thanks :user:`wonderbeyond` 910 for reporting and thanks :user:`yoichi` for the PR. 911 9123.0.0b3 (2017-08-20) 913++++++++++++++++++++ 914 915Features: 916 917- Add ``valid_data`` attribute to ``ValidationError``. 918- Add ``strict`` parameter to ``Integer`` (:issue:`667`). Thanks 919 :user:`yoichi`. 920 921Deprecations/Removals: 922 923- Deprecate ``json_module`` option in favor of ``render_module`` (:issue:`364`, :issue:`130`). Thanks :user:`justanr` for the suggestion. 924 925Bug fixes: 926 927- Includes bug fixes from releases 2.13.5 and 2.13.6. 928- *Backwards-incompatible*: ``Number`` fields don't accept booleans as valid input (:issue:`623`). Thanks :user:`tuukkamustonen` for the suggestion and thanks :user:`rowillia` for the PR. 929 930Support: 931 932- Add benchmark script. Thanks :user:`rowillia`. 933 9343.0.0b2 (2017-03-19) 935++++++++++++++++++++ 936 937Features: 938 939- Add ``truthy`` and ``falsy`` params to ``fields.Boolean`` (:issue:`580`). Thanks :user:`zwack` for the PR. Note: This is potentially a breaking change if your code passes the `default` parameter positionally. Pass `default` as a keyword argument instead, e.g. ``fields.Boolean(default=True)``. 940 941Other changes: 942 943- *Backwards-incompatible*: ``validate.ContainsOnly`` allows empty and duplicate values (:issue:`516`, :issue:`603`). Thanks :user:`maximkulkin` for the suggestion and thanks :user:`lafrech` for the PR. 944 945Bug fixes: 946 947- Includes bug fixes from release 2.13.4. 948 9493.0.0b1 (2017-03-10) 950++++++++++++++++++++ 951 952Features: 953 954- ``fields.Nested`` respects ``only='field'`` when deserializing (:issue:`307`). Thanks :user:`erlingbo` for the suggestion and the PR. 955- ``fields.Boolean`` parses ``"on"``/``"off"`` (:issue:`580`). Thanks :user:`marcellarius` for the suggestion. 956 957 958Other changes: 959 960- Includes changes from release 2.13.2. 961- *Backwards-incompatible*: ``skip_on_field_errors`` defaults to ``True`` for ``validates_schema`` (:issue:`352`). 962 9633.0.0a1 (2017-02-26) 964++++++++++++++++++++ 965 966Features: 967 968- ``dump_only`` and ``load_only`` for ``Function`` and ``Method`` are set based on ``serialize`` and ``deserialize`` arguments (:issue:`328`). 969 970Other changes: 971 972- *Backwards-incompatible*: ``fields.Method`` and ``fields.Function`` no longer swallow ``AttributeErrors`` (:issue:`395`). Thanks :user:`bereal` for the suggestion. 973- *Backwards-incompatible*: ``validators.Length`` is no longer a subclass of ``validators.Range`` (:issue:`458`). Thanks :user:`deckar01` for the catch and patch. 974- *Backwards-incompatible*: ``utils.get_func_args`` no longer returns bound arguments. This is consistent with the behavior of ``inspect.signature``. This change prevents a DeprecationWarning on Python 3.5 (:issue:`415`, :issue:`479`). Thanks :user:`deckar01` for the PR. 975- *Backwards-incompatible*: Change the signature of ``utils.get_value`` and ``Schema.get_attribute`` for consistency with Python builtins (e.g. ``getattr``) (:issue:`341`). Thanks :user:`stas` for reporting and thanks :user:`deckar01` for the PR. 976- *Backwards-incompatible*: Don't unconditionally call callable attributes (:issue:`430`, reverts :issue:`242`). Thanks :user:`mirko` for the suggestion. 977- Drop support for Python 2.6 and 3.3. 978 979Deprecation/Removals: 980 981- Remove ``__error_handler__``, ``__accessor__``, ``@Schema.error_handler``, and ``@Schema.accessor``. Override ``Schema.handle_error`` and ``Schema.get_attribute`` instead. 982- Remove ``func`` parameter of ``fields.Function``. Remove ``method_name`` parameter of ``fields.Method`` (issue:`325`). Use the ``serialize`` parameter instead. 983- Remove ``extra`` parameter from ``Schema``. Use a ``@post_dump`` method to add additional data. 984 9852.21.0 (2020-03-05) 986+++++++++++++++++++ 987 988Bug fixes: 989 990- Don't match string-ending newlines in ``URL`` and ``Email`` fields 991 (:issue:`1522`). Thanks :user:`nbanmp` for the PR. 992 993Other changes: 994 995- Drop support for Python 3.4 (:pr:`1525`). 996 9972.20.5 (2019-09-15) 998+++++++++++++++++++ 999 1000Bug fixes: 1001 1002- Fix behavior when a non-list collection is passed to the ``validate`` argument of ``fields.Email`` and ``fields.URL`` (:issue:`1400`). 1003 10042.20.4 (2019-09-11) 1005+++++++++++++++++++ 1006 1007Bug fixes: 1008 1009- Respect the ``many`` value on ``Schema`` instances passed to ``Nested`` (:issue:`1160`). 1010 Thanks :user:`Kamforka` for reporting. 1011 10122.20.3 (2019-09-04) 1013+++++++++++++++++++ 1014 1015Bug fixes: 1016 1017- Don't swallow ``TypeError`` exceptions raised by ``Field._bind_to_schema`` or ``Schema.on_bind_field`` (:pr:`1376`). 1018 10192.20.2 (2019-08-20) 1020+++++++++++++++++++ 1021 1022Bug fixes: 1023 1024- Prevent warning about importing from ``collections`` on Python 3.7 1025 (:pr:`1354`). Thanks :user:`nicktimko` for the PR. 1026 10272.20.1 (2019-08-13) 1028+++++++++++++++++++ 1029 1030Bug fixes: 1031 1032- Fix bug that raised ``TypeError`` when invalid data type is 1033 passed to a nested schema with ``@validates`` (:issue:`1342`). 1034 10352.20.0 (2019-08-10) 1036+++++++++++++++++++ 1037 1038Bug fixes: 1039 1040- Fix deprecated functions' compatibility with Python 2 (:issue:`1337`). 1041 Thanks :user:`airstandley` for the catch and patch. 1042- Fix error message consistency for invalid input types on nested fields (:issue:`1303`). 1043 This is a backport of the fix in :pr:`857`. Thanks :user:`cristi23` for the 1044 thorough bug report and the PR. 1045 1046Deprecation/Removal: 1047 1048- Python 2.6 is no longer officially supported (:issue:`1274`). 1049 10502.19.5 (2019-06-18) 1051+++++++++++++++++++ 1052 1053Bug fixes: 1054 1055- Fix deserializing ISO8601-formatted datetimes with less than 6-digit 1056 miroseconds (:issue:`1251`). Thanks :user:`diego-plan9` for reporting. 1057 10582.19.4 (2019-06-16) 1059+++++++++++++++++++ 1060 1061Bug fixes: 1062 1063- Microseconds no longer gets lost when deserializing datetimes without dateutil 1064 installed (:issue:`1147`). 1065 10662.19.3 (2019-06-15) 1067+++++++++++++++++++ 1068 1069Bug fixes: 1070 1071- Fix bug where nested fields in ``Meta.exclude`` would not work on 1072 multiple instantiations (:issue:`1212`). Thanks :user:`MHannila` for 1073 reporting. 1074 10752.19.2 (2019-03-30) 1076+++++++++++++++++++ 1077 1078Bug fixes: 1079 1080- Handle ``OverflowError`` when (de)serializing large integers with 1081 ``fields.Float`` (:pr:`1177`). Thanks :user:`brycedrennan` for the PR. 1082 10832.19.1 (2019-03-16) 1084+++++++++++++++++++ 1085 1086Bug fixes: 1087 1088- Fix bug where ``Nested(many=True)`` would skip first element when 1089 serializing a generator (:issue:`1163`). Thanks :user:`khvn26` for the 1090 catch and patch. 1091 10922.19.0 (2019-03-07) 1093+++++++++++++++++++ 1094 1095Deprecation/Removal: 1096 1097- A ``RemovedInMarshmallow3`` warning is raised when using 1098 ``fields.FormattedString``. Use ``fields.Method`` or ``fields.Function`` 1099 instead (:issue:`1141`). 1100 11012.18.1 (2019-02-15) 1102+++++++++++++++++++ 1103 1104Bug fixes: 1105 1106- A ``ChangedInMarshmallow3Warning`` is no longer raised when 1107 ``strict=False`` (:issue:`1108`). Thanks :user:`Aegdesil` for 1108 reporting. 1109 11102.18.0 (2019-01-13) 1111+++++++++++++++++++ 1112 1113Features: 1114 1115- Add warnings for functions in ``marshmallow.utils`` that are removed in 1116 marshmallow 3. 1117 1118Bug fixes: 1119 1120- Copying ``missing`` with ``copy.copy`` or ``copy.deepcopy`` will not 1121 duplicate it (:pr:`1099`). 1122 11232.17.0 (2018-12-26) 1124+++++++++++++++++++ 1125 1126Features: 1127 1128- Add ``marshmallow.__version_info__`` (:pr:`1074`). 1129- Add warnings for API that is deprecated or changed to help users 1130 prepare for marshmallow 3 (:pr:`1075`). 1131 11322.16.3 (2018-11-01) 1133+++++++++++++++++++ 1134 1135Bug fixes: 1136 1137- Prevent memory leak when dynamically creating classes with ``type()`` 1138 (:issue:`732`). Thanks :user:`asmodehn` for writing the tests to 1139 reproduce this issue. 1140 11412.16.2 (2018-10-30) 1142+++++++++++++++++++ 1143 1144Bug fixes: 1145 1146- Prevent warning about importing from ``collections`` on Python 3.7 1147 (:issue:`1027`). Thanks :user:`nkonin` for reporting and 1148 :user:`jmargeta` for the PR. 1149 11502.16.1 (2018-10-17) 1151+++++++++++++++++++ 1152 1153Bug fixes: 1154 1155- Remove spurious warning about implicit collection handling 1156 (:issue:`998`). Thanks :user:`lalvarezguillen` for reporting. 1157 11582.16.0 (2018-10-10) 1159+++++++++++++++++++ 1160 1161Bug fixes: 1162 1163- Allow username without password in basic auth part of the url in 1164 ``fields.Url`` (:pr:`982`). Thanks user:`alefnula` for the PR. 1165 1166Other changes: 1167 1168- Drop support for Python 3.3 (:pr:`987`). 1169 11702.15.6 (2018-09-20) 1171+++++++++++++++++++ 1172 1173Bug fixes: 1174 1175- Prevent ``TypeError`` when a non-collection is passed to a ``Schema`` with ``many=True``. 1176 Instead, raise ``ValidationError`` with ``{'_schema': ['Invalid input type.']}`` (:issue:`906`). 1177- Fix ``root`` attribute for nested container fields on list 1178 on inheriting schemas (:issue:`956`). Thanks :user:`bmcbu` 1179 for reporting. 1180 1181These fixes were backported from 3.0.0b15 and 3.0.0b16. 1182 1183 11842.15.5 (2018-09-15) 1185+++++++++++++++++++ 1186 1187Bug fixes: 1188 1189- Handle empty SQLAlchemy lazy lists gracefully when dumping (:issue:`948`). 1190 Thanks :user:`vke-code` for the catch and :user:`YuriHeupa` for the patch. 1191 11922.15.4 (2018-08-04) 1193+++++++++++++++++++ 1194 1195Bug fixes: 1196 1197- Respect ``load_from`` when reporting errors for ``@validates('field_name')`` 1198 (:issue:`748`). Thanks :user:`m-novikov` for the catch and patch. 1199 12002.15.3 (2018-05-20) 1201+++++++++++++++++++ 1202 1203Bug fixes: 1204 1205- Fix passing ``only`` as a string to ``nested`` when the passed field 1206 defines ``dump_to`` (:issue:`800`, :issue:`822`). Thanks 1207 :user:`deckar01` for the catch and patch. 1208 12092.15.2 (2018-05-10) 1210+++++++++++++++++++ 1211 1212Bug fixes: 1213 1214- Fix a race condition in validation when concurrent threads use the 1215 same ``Schema`` instance (:issue:`783`). Thanks :user:`yupeng0921` and 1216 :user:`lafrech` for the fix. 1217- Fix serialization behavior of 1218 ``fields.List(fields.Integer(as_string=True))`` (:issue:`788`). Thanks 1219 :user:`cactus` for reporting and :user:`lafrech` for the fix. 1220- Fix behavior of ``exclude`` parameter when passed from parent to 1221 nested schemas (:issue:`728`). Thanks :user:`timc13` for reporting and 1222 :user:`deckar01` for the fix. 1223 12242.15.1 (2018-04-25) 1225+++++++++++++++++++ 1226 1227Bug fixes: 1228 1229- :cve:`CVE-2018-17175`: Fix behavior when an empty list is passed as the ``only`` argument 1230 (:issue:`772`). Thanks :user:`deckar01` for reporting and thanks 1231 :user:`lafrech` for the fix. 1232 12332.15.0 (2017-12-02) 1234+++++++++++++++++++ 1235 1236Bug fixes: 1237 1238- Handle ``UnicodeDecodeError`` when deserializing ``bytes`` with a 1239 ``String`` field (:issue:`650`). Thanks :user:`dan-blanchard` for the 1240 suggestion and thanks :user:`4lissonsilveira` for the PR. 1241 12422.14.0 (2017-10-23) 1243+++++++++++++++++++ 1244 1245Features: 1246 1247- Add ``require_tld`` parameter to ``validate.URL`` (:issue:`664`). 1248 Thanks :user:`sduthil` for the suggestion and the PR. 1249 12502.13.6 (2017-08-16) 1251+++++++++++++++++++ 1252 1253Bug fixes: 1254 1255- Fix serialization of types that implement `__getitem__` 1256 (:issue:`669`). Thanks :user:`MichalKononenko`. 1257 12582.13.5 (2017-04-12) 1259+++++++++++++++++++ 1260 1261Bug fixes: 1262 1263- Fix validation of iso8601-formatted dates (:issue:`556`). Thanks :user:`lafrech` for reporting. 1264 12652.13.4 (2017-03-19) 1266+++++++++++++++++++ 1267 1268Bug fixes: 1269 1270- Fix symmetry of serialization and deserialization behavior when passing a dot-delimited path to the ``attribute`` parameter of fields (:issue:`450`). Thanks :user:`itajaja` for reporting. 1271 12722.13.3 (2017-03-11) 1273+++++++++++++++++++ 1274 1275Bug fixes: 1276 1277- Restore backwards-compatibility of ``SchemaOpts`` constructor (:issue:`597`). Thanks :user:`Wesmania` for reporting and thanks :user:`frol` for the fix. 1278 12792.13.2 (2017-03-10) 1280+++++++++++++++++++ 1281 1282Bug fixes: 1283 1284- Fix inheritance of ``ordered`` option when ``Schema`` subclasses define ``class Meta`` (:issue:`593`). Thanks :user:`frol`. 1285 1286Support: 1287 1288- Update contributing docs. 1289 12902.13.1 (2017-03-04) 1291+++++++++++++++++++ 1292 1293Bug fixes: 1294 1295- Fix sorting on Schema subclasses when ``ordered=True`` (:issue:`592`). Thanks :user:`frol`. 1296 12972.13.0 (2017-02-18) 1298+++++++++++++++++++ 1299 1300Features: 1301 1302- Minor optimizations (:issue:`577`). Thanks :user:`rowillia` for the PR. 1303 13042.12.2 (2017-01-30) 1305+++++++++++++++++++ 1306 1307Bug fixes: 1308 1309- Unbound fields return `None` rather returning the field itself. This fixes a corner case introduced in :issue:`572`. Thanks :user:`touilleMan` for reporting and :user:`YuriHeupa` for the fix. 1310 13112.12.1 (2017-01-23) 1312+++++++++++++++++++ 1313 1314Bug fixes: 1315 1316- Fix behavior when a ``Nested`` field is composed within a ``List`` field (:issue:`572`). Thanks :user:`avish` for reporting and :user:`YuriHeupa` for the PR. 1317 13182.12.0 (2017-01-22) 1319+++++++++++++++++++ 1320 1321Features: 1322 1323- Allow passing nested attributes (e.g. ``'child.field'``) to the ``dump_only`` and ``load_only`` parameters of ``Schema`` (:issue:`572`). Thanks :user:`YuriHeupa` for the PR. 1324- Add ``schemes`` parameter to ``fields.URL`` (:issue:`574`). Thanks :user:`mosquito` for the PR. 1325 13262.11.1 (2017-01-08) 1327+++++++++++++++++++ 1328 1329Bug fixes: 1330 1331- Allow ``strict`` class Meta option to be overriden by constructor (:issue:`550`). Thanks :user:`douglas-treadwell` for reporting and thanks :user:`podhmo` for the PR. 1332 13332.11.0 (2017-01-08) 1334+++++++++++++++++++ 1335 1336Features: 1337 1338- Import ``marshmallow.fields`` in ``marshmallow/__init__.py`` to save an import when importing the ``marshmallow`` module (:issue:`557`). Thanks :user:`mindojo-victor`. 1339 1340Support: 1341 1342- Documentation: Improve example in "Validating Original Input Data" (:issue:`558`). Thanks :user:`altaurog`. 1343- Test against Python 3.6. 1344 13452.10.5 (2016-12-19) 1346+++++++++++++++++++ 1347 1348Bug fixes: 1349 1350- Reset user-defined kwargs passed to ``ValidationError`` on each ``Schema.load`` call (:issue:`565`). Thanks :user:`jbasko` for the catch and patch. 1351 1352Support: 1353 1354- Tests: Fix redefinition of ``test_utils.test_get_value()`` (:issue:`562`). Thanks :user:`nelfin`. 1355 13562.10.4 (2016-11-18) 1357+++++++++++++++++++ 1358 1359Bug fixes: 1360 1361- `Function` field works with callables that use Python 3 type annotations (:issue:`540`). Thanks :user:`martinstein` for reporting and thanks :user:`sabinem`, :user:`lafrech`, and :user:`maximkulkin` for the work on the PR. 1362 13632.10.3 (2016-10-02) 1364+++++++++++++++++++ 1365 1366Bug fixes: 1367 1368- Fix behavior for serializing missing data with ``Number`` fields when ``as_string=True`` is passed (:issue:`538`). Thanks :user:`jessemyers` for reporting. 1369 13702.10.2 (2016-09-25) 1371+++++++++++++++++++ 1372 1373Bug fixes: 1374 1375- Use fixed-point notation rather than engineering notation when serializing with ``Decimal`` (:issue:`534`). Thanks :user:`gdub`. 1376- Fix UUID validation on serialization and deserialization of ``uuid.UUID`` objects (:issue:`532`). Thanks :user:`pauljz`. 1377 13782.10.1 (2016-09-14) 1379+++++++++++++++++++ 1380 1381Bug fixes: 1382 1383- Fix behavior when using ``validate.Equal(False)`` (:issue:`484`). Thanks :user:`pktangyue` for reporting and thanks :user:`tuukkamustonen` for the fix. 1384- Fix ``strict`` behavior when errors are raised in ``pre_dump``/``post_dump`` processors (:issue:`521`). Thanks :user:`tvuotila` for the catch and patch. 1385- Fix validation of nested fields on dumping (:issue:`528`). Thanks again :user:`tvuotila`. 1386 13872.10.0 (2016-09-05) 1388+++++++++++++++++++ 1389 1390Features: 1391 1392- Errors raised by pre/post-load/dump methods will be added to a schema's errors dictionary (:issue:`472`). Thanks :user:`dbertouille` for the suggestion and for the PR. 1393 13942.9.1 (2016-07-21) 1395++++++++++++++++++ 1396 1397Bug fixes: 1398 1399- Fix serialization of ``datetime.time`` objects with microseconds (:issue:`464`). Thanks :user:`Tim-Erwin` for reporting and thanks :user:`vuonghv` for the fix. 1400- Make ``@validates`` consistent with field validator behavior: if validation fails, the field will not be included in the deserialized output (:issue:`391`). Thanks :user:`martinstein` for reporting and thanks :user:`vuonghv` for the fix. 1401 14022.9.0 (2016-07-06) 1403++++++++++++++++++ 1404 1405- ``Decimal`` field coerces input values to a string before deserializing to a `decimal.Decimal` object in order to avoid transformation of float values under 12 significant digits (:issue:`434`, :issue:`435`). Thanks :user:`davidthornton` for the PR. 1406 14072.8.0 (2016-06-23) 1408++++++++++++++++++ 1409 1410Features: 1411 1412- Allow ``only`` and ``exclude`` parameters to take nested fields, using dot-delimited syntax (e.g. ``only=['blog.author.email']``) (:issue:`402`). Thanks :user:`Tim-Erwin` and :user:`deckar01` for the discussion and implementation. 1413 1414Support: 1415 1416- Update tasks.py for compatibility with invoke>=0.13.0. Thanks :user:`deckar01`. 1417 14182.7.3 (2016-05-05) 1419++++++++++++++++++ 1420 1421- Make ``field.parent`` and ``field.name`` accessible to ``on_bind_field`` (:issue:`449`). Thanks :user:`immerrr`. 1422 14232.7.2 (2016-04-27) 1424++++++++++++++++++ 1425 1426No code changes in this release. This is a reupload in order to distribute an sdist for the last hotfix release. See :issue:`443`. 1427 1428Support: 1429 1430- Update license entry in setup.py to fix RPM distributions (:issue:`433`). Thanks :user:`rrajaravi` for reporting. 1431 14322.7.1 (2016-04-08) 1433++++++++++++++++++ 1434 1435Bug fixes: 1436 1437- Only add Schemas to class registry if a class name is provided. This allows Schemas to be 1438 constructed dynamically using the ``type`` constructor without getting added to the class registry (which is useful for saving memory). 1439 14402.7.0 (2016-04-04) 1441++++++++++++++++++ 1442 1443Features: 1444 1445- Make context available to ``Nested`` field's ``on_bind_field`` method (:issue:`408`). Thanks :user:`immerrr` for the PR. 1446- Pass through user ``ValidationError`` kwargs (:issue:`418`). Thanks :user:`russelldavies` for helping implement this. 1447 1448Other changes: 1449 1450- Remove unused attributes ``root``, ``parent``, and ``name`` from ``SchemaABC`` (:issue:`410`). Thanks :user:`Tim-Erwin` for the PR. 1451 14522.6.1 (2016-03-17) 1453++++++++++++++++++ 1454 1455Bug fixes: 1456 1457- Respect ``load_from`` when reporting errors for nested required fields (:issue:`414`). Thanks :user:`yumike`. 1458 14592.6.0 (2016-02-01) 1460++++++++++++++++++ 1461 1462Features: 1463 1464- Add ``partial`` argument to ``Schema.validate`` (:issue:`379`). Thanks :user:`tdevelioglu` for the PR. 1465- Add ``equal`` argument to ``validate.Length``. Thanks :user:`daniloakamine`. 1466- Collect all validation errors for each item deserialized by a ``List`` field (:issue:`345`). Thanks :user:`maximkulkin` for the report and the PR. 1467 14682.5.0 (2016-01-16) 1469++++++++++++++++++ 1470 1471Features: 1472 1473- Allow a tuple of field names to be passed as the ``partial`` argument to ``Schema.load`` (:issue:`369`). Thanks :user:`tdevelioglu` for the PR. 1474- Add ``schemes`` argument to ``validate.URL`` (:issue:`356`). 1475 14762.4.2 (2015-12-08) 1477++++++++++++++++++ 1478 1479Bug fixes: 1480 1481- Prevent duplicate error messages when validating nested collections (:issue:`360`). Thanks :user:`alexmorken` for the catch and patch. 1482 14832.4.1 (2015-12-07) 1484++++++++++++++++++ 1485 1486Bug fixes: 1487 1488- Serializing an iterator will not drop the first item (:issue:`343`, :issue:`353`). Thanks :user:`jmcarp` for the patch. Thanks :user:`edgarallang` and :user:`jmcarp` for reporting. 1489 14902.4.0 (2015-12-06) 1491++++++++++++++++++ 1492 1493Features: 1494 1495- Add ``skip_on_field_errors`` parameter to ``validates_schema`` (:issue:`323`). Thanks :user:`jjvattamattom` for the suggestion and :user:`d-sutherland` for the PR. 1496 1497Bug fixes: 1498 1499- Fix ``FormattedString`` serialization (:issue:`348`). Thanks :user:`acaird` for reporting. 1500- Fix ``@validates`` behavior when used when ``attribute`` is specified and ``strict=True`` (:issue:`350`). Thanks :user:`density` for reporting. 1501 15022.3.0 (2015-11-22) 1503++++++++++++++++++ 1504 1505Features: 1506 1507- Add ``dump_to`` parameter to fields (:issue:`310`). Thanks :user:`ShayanArmanPercolate` for the suggestion. Thanks :user:`franciscod` and :user:`ewang` for the PRs. 1508- The ``deserialize`` function passed to ``fields.Function`` can optionally receive a ``context`` argument (:issue:`324`). Thanks :user:`DamianHeard`. 1509- The ``serialize`` function passed to ``fields.Function`` is optional (:issue:`325`). Thanks again :user:`DamianHeard`. 1510- The ``serialize`` function passed to ``fields.Method`` is optional (:issue:`329`). Thanks :user:`justanr`. 1511 1512Deprecation/Removal: 1513 1514- The ``func`` argument of ``fields.Function`` has been renamed to ``serialize``. 1515- The ``method_name`` argument of ``fields.Method`` has been renamed to ``serialize``. 1516 1517``func`` and ``method_name`` are still present for backwards-compatibility, but they will both be removed in marshmallow 3.0. 1518 15192.2.1 (2015-11-11) 1520++++++++++++++++++ 1521 1522Bug fixes: 1523 1524- Skip field validators for fields that aren't included in ``only`` (:issue:`320`). Thanks :user:`carlos-alberto` for reporting and :user:`eprikazc` for the PR. 1525 15262.2.0 (2015-10-26) 1527++++++++++++++++++ 1528 1529Features: 1530 1531- Add support for partial deserialization with the ``partial`` argument to ``Schema`` and ``Schema.load`` (:issue:`290`). Thanks :user:`taion`. 1532 1533Deprecation/Removals: 1534 1535- ``Query`` and ``QuerySelect`` fields are removed. 1536- Passing of strings to ``required`` and ``allow_none`` is removed. Pass the ``error_messages`` argument instead. 1537 1538Support: 1539 1540- Add example of Schema inheritance in docs (:issue:`225`). Thanks :user:`martinstein` for the suggestion and :user:`juanrossi` for the PR. 1541- Add "Customizing Error Messages" section to custom fields docs. 1542 15432.1.3 (2015-10-18) 1544++++++++++++++++++ 1545 1546Bug fixes: 1547 1548- Fix serialization of collections for which ``iter`` will modify position, e.g. Pymongo cursors (:issue:`303`). Thanks :user:`Mise` for the catch and patch. 1549 15502.1.2 (2015-10-14) 1551++++++++++++++++++ 1552 1553Bug fixes: 1554 1555- Fix passing data to schema validator when using ``@validates_schema(many=True)`` (:issue:`297`). Thanks :user:`d-sutherland` for reporting. 1556- Fix usage of ``@validates`` with a nested field when ``many=True`` (:issue:`298`). Thanks :user:`nelfin` for the catch and patch. 1557 15582.1.1 (2015-10-07) 1559++++++++++++++++++ 1560 1561Bug fixes: 1562 1563- ``Constant`` field deserializes to its value regardless of whether its field name is present in input data (:issue:`291`). Thanks :user:`fayazkhan` for reporting. 1564 15652.1.0 (2015-09-30) 1566++++++++++++++++++ 1567 1568Features: 1569 1570- Add ``Dict`` field for arbitrary mapping data (:issue:`251`). Thanks :user:`dwieeb` for adding this and :user:`Dowwie` for the suggestion. 1571- Add ``Field.root`` property, which references the field's Schema. 1572 1573Deprecation/Removals: 1574 1575- The ``extra`` param of ``Schema`` is deprecated. Add extra data in a ``post_load`` method instead. 1576- ``UnmarshallingError`` and ``MarshallingError`` are removed. 1577 1578Bug fixes: 1579 1580- Fix storing multiple schema-level validation errors (:issue:`287`). Thanks :user:`evgeny-sureev` for the patch. 1581- If ``missing=None`` on a field, ``allow_none`` will be set to ``True``. 1582 1583Other changes: 1584 1585- A ``List's`` inner field will have the list field set as its parent. Use ``root`` to access the ``Schema``. 1586 15872.0.0 (2015-09-25) 1588++++++++++++++++++ 1589 1590Features: 1591 1592- Make error messages configurable at the class level and instance level (``Field.default_error_messages`` attribute and ``error_messages`` parameter, respectively). 1593 1594Deprecation/Removals: 1595 1596- Remove ``make_object``. Use a ``post_load`` method instead (:issue:`277`). 1597- Remove the ``error`` parameter and attribute of ``Field``. 1598- Passing string arguments to ``required`` and ``allow_none`` is deprecated. Pass the ``error_messages`` argument instead. **This API will be removed in version 2.2**. 1599- Remove ``Arbitrary``, ``Fixed``, and ``Price`` fields (:issue:`86`). Use ``Decimal`` instead. 1600- Remove ``Select`` / ``Enum`` fields (:issue:`135`). Use the ``OneOf`` validator instead. 1601 1602Bug fixes: 1603 1604- Fix error format for ``Nested`` fields when ``many=True``. Thanks :user:`alexmorken`. 1605- ``pre_dump`` methods are invoked before implicit field creation. Thanks :user:`makmanalp` for reporting. 1606- Return correct "required" error message for ``Nested`` field. 1607- The ``only`` argument passed to a ``Schema`` is bounded by the ``fields`` option (:issue:`183`). Thanks :user:`lustdante` for the suggestion. 1608 1609Changes from 2.0.0rc2: 1610 1611- ``error_handler`` and ``accessor`` options are replaced with the ``handle_error`` and ``get_attribute`` methods :issue:`284`. 1612- Remove ``marshmallow.compat.plain_function`` since it is no longer used. 1613- Non-collection values are invalid input for ``List`` field (:issue:`231`). Thanks :user:`density` for reporting. 1614- Bug fix: Prevent infinite loop when validating a required, self-nested field. Thanks :user:`Bachmann1234` for the fix. 1615 16162.0.0rc2 (2015-09-16) 1617+++++++++++++++++++++ 1618 1619Deprecation/Removals: 1620 1621- ``make_object`` is deprecated. Use a ``post_load`` method instead (:issue:`277`). **This method will be removed in the final 2.0 release**. 1622- ``Schema.accessor`` and ``Schema.error_handler`` decorators are deprecated. Define the ``accessor`` and ``error_handler`` class Meta options instead. 1623 1624Bug fixes: 1625 1626- Allow non-field names to be passed to ``ValidationError`` (:issue:`273`). Thanks :user:`evgeny-sureev` for the catch and patch. 1627 1628Changes from 2.0.0rc1: 1629 1630- The ``raw`` parameter of the ``pre_*``, ``post_*``, ``validates_schema`` decorators was renamed to ``pass_many`` (:issue:`276`). 1631- Add ``pass_original`` parameter to ``post_load`` and ``post_dump`` (:issue:`216`). 1632- Methods decorated with the ``pre_*``, ``post_*``, and ``validates_*`` decorators must be instance methods. Class methods and instance methods are not supported at this time. 1633 16342.0.0rc1 (2015-09-13) 1635+++++++++++++++++++++ 1636 1637Features: 1638 1639- *Backwards-incompatible*: ``fields.Field._deserialize`` now takes ``attr`` and ``data`` as arguments (:issue:`172`). Thanks :user:`alexmic` and :user:`kevinastone` for the suggestion. 1640- Allow a ``Field's`` ``attribute`` to be modified during deserialization (:issue:`266`). Thanks :user:`floqqi`. 1641- Allow partially-valid data to be returned for ``Nested`` fields (:issue:`269`). Thanks :user:`jomag` for the suggestion. 1642- Add ``Schema.on_bind_field`` hook which allows a ``Schema`` to modify its fields when they are bound. 1643- Stricter validation of string, boolean, and number fields (:issue:`231`). Thanks :user:`touilleMan` for the suggestion. 1644- Improve consistency of error messages. 1645 1646Deprecation/Removals: 1647 1648- ``Schema.validator``, ``Schema.preprocessor``, and ``Schema.data_handler`` are removed. Use ``validates_schema``, ``pre_load``, and ``post_dump`` instead. 1649- ``QuerySelect`` and ``QuerySelectList`` are deprecated (:issue:`227`). **These fields will be removed in version 2.1.** 1650- ``utils.get_callable_name`` is removed. 1651 1652Bug fixes: 1653 1654- If a date format string is passed to a ``DateTime`` field, it is always used for deserialization (:issue:`248`). Thanks :user:`bartaelterman` and :user:`praveen-p`. 1655 1656Support: 1657 1658- Documentation: Add "Using Context" section to "Extending Schemas" page (:issue:`224`). 1659- Include tests and docs in release tarballs (:issue:`201`). 1660- Test against Python 3.5. 1661 16622.0.0b5 (2015-08-23) 1663++++++++++++++++++++ 1664 1665Features: 1666 1667- If a field corresponds to a callable attribute, it will be called upon serialization. Thanks :user:`alexmorken`. 1668- Add ``load_only`` and ``dump_only`` ``class Meta`` options. Thanks :user:`kelvinhammond`. 1669- If a ``Nested`` field is required, recursively validate any required fields in the nested schema (:issue:`235`). Thanks :user:`max-orhai`. 1670- Improve error message if a list of dicts is not passed to a ``Nested`` field for which ``many=True``. Thanks again :user:`max-orhai`. 1671 1672Bug fixes: 1673 1674- ``make_object`` is only called after all validators and postprocessors have finished (:issue:`253`). Thanks :user:`sunsongxp` for reporting. 1675- If an invalid type is passed to ``Schema`` and ``strict=False``, store a ``_schema`` error in the errors dict rather than raise an exception (:issue:`261`). Thanks :user:`density` for reporting. 1676 1677Other changes: 1678 1679- ``make_object`` is only called when input data are completely valid (:issue:`243`). Thanks :user:`kissgyorgy` for reporting. 1680- Change default error messages for ``URL`` and ``Email`` validators so that they don't include user input (:issue:`255`). 1681- ``Email`` validator permits email addresses with non-ASCII characters, as per RFC 6530 (:issue:`221`). Thanks :user:`lextoumbourou` for reporting and :user:`mwstobo` for sending the patch. 1682 16832.0.0b4 (2015-07-07) 1684++++++++++++++++++++ 1685 1686Features: 1687 1688- ``List`` field respects the ``attribute`` argument of the inner field. Thanks :user:`jmcarp`. 1689- The ``container`` field ``List`` field has access to its parent ``Schema`` via its ``parent`` attribute. Thanks again :user:`jmcarp`. 1690 1691Deprecation/Removals: 1692 1693- Legacy validator functions have been removed (:issue:`73`). Use the class-based validators in ``marshmallow.validate`` instead. 1694 1695Bug fixes: 1696 1697- ``fields.Nested`` correctly serializes nested ``sets`` (:issue:`233`). Thanks :user:`traut`. 1698 1699Changes from 2.0.0b3: 1700 1701- If ``load_from`` is used on deserialization, the value of ``load_from`` is used as the key in the errors dict (:issue:`232`). Thanks :user:`alexmorken`. 1702 17032.0.0b3 (2015-06-14) 1704+++++++++++++++++++++ 1705 1706Features: 1707 1708- Add ``marshmallow.validates_schema`` decorator for defining schema-level validators (:issue:`116`). 1709- Add ``marshmallow.validates`` decorator for defining field validators as Schema methods (:issue:`116`). Thanks :user:`philtay`. 1710- Performance improvements. 1711- Defining ``__marshallable__`` on complex objects is no longer necessary. 1712- Add ``fields.Constant``. Thanks :user:`kevinastone`. 1713 1714Deprecation/Removals: 1715 1716- Remove ``skip_missing`` class Meta option. By default, missing inputs are excluded from serialized output (:issue:`211`). 1717- Remove optional ``context`` parameter that gets passed to methods for ``Method`` fields. 1718- ``Schema.validator`` is deprecated. Use ``marshmallow.validates_schema`` instead. 1719- ``utils.get_func_name`` is removed. Use ``utils.get_callable_name`` instead. 1720 1721Bug fixes: 1722 1723- Fix serializing values from keyed tuple types (regression of :issue:`28`). Thanks :user:`makmanalp` for reporting. 1724 1725Other changes: 1726 1727- Remove unnecessary call to ``utils.get_value`` for ``Function`` and ``Method`` fields (:issue:`208`). Thanks :user:`jmcarp`. 1728- Serializing a collection without passing ``many=True`` will not result in an error. Be very careful to pass the ``many`` argument when necessary. 1729 1730Support: 1731 1732- Documentation: Update Flask and Peewee examples. Update Quickstart. 1733 1734Changes from 2.0.0b2: 1735 1736- ``Boolean`` field serializes ``None`` to ``None``, for consistency with other fields (:issue:`213`). Thanks :user:`cmanallen` for reporting. 1737- Bug fix: ``load_only`` fields do not get validated during serialization. 1738- Implicit passing of original, raw data to Schema validators is removed. Use ``@marshmallow.validates_schema(pass_original=True)`` instead. 1739 17402.0.0b2 (2015-05-03) 1741++++++++++++++++++++ 1742 1743Features: 1744 1745- Add useful ``__repr__`` methods to validators (:issue:`204`). Thanks :user:`philtay`. 1746- *Backwards-incompatible*: By default, ``NaN``, ``Infinity``, and ``-Infinity`` are invalid values for ``fields.Decimal``. Pass ``allow_nan=True`` to allow these values. Thanks :user:`philtay`. 1747 1748Changes from 2.0.0b1: 1749 1750- Fix serialization of ``None`` for ``Time``, ``TimeDelta``, and ``Date`` fields (a regression introduced in 2.0.0a1). 1751 1752Includes bug fixes from 1.2.6. 1753 17542.0.0b1 (2015-04-26) 1755++++++++++++++++++++ 1756 1757Features: 1758 1759- Errored fields will not appear in (de)serialized output dictionaries (:issue:`153`, :issue:`202`). 1760- Instantiate ``OPTIONS_CLASS`` in ``SchemaMeta``. This makes ``Schema.opts`` available in metaclass methods. It also causes validation to occur earlier (upon ``Schema`` class declaration rather than instantiation). 1761- Add ``SchemaMeta.get_declared_fields`` class method to support adding additional declared fields. 1762 1763Deprecation/Removals: 1764 1765- Remove ``allow_null`` parameter of ``fields.Nested`` (:issue:`203`). 1766 1767Changes from 2.0.0a1: 1768 1769- Fix serialization of `None` for ``fields.Email``. 1770 17712.0.0a1 (2015-04-25) 1772++++++++++++++++++++ 1773 1774Features: 1775 1776- *Backwards-incompatible*: When ``many=True``, the errors dictionary returned by ``dump`` and ``load`` will be keyed on the indices of invalid items in the (de)serialized collection (:issue:`75`). Add ``index_errors=False`` on a Schema's ``class Meta`` options to disable this behavior. 1777- *Backwards-incompatible*: By default, fields will raise a ValidationError if the input is ``None``. The ``allow_none`` parameter can override this behavior. 1778- *Backwards-incompatible*: A ``Field's`` ``default`` parameter is only used if explicitly set and the field's value is missing in the input to `Schema.dump`. If not set, the key will not be present in the serialized output for missing values . This is the behavior for *all* fields. ``fields.Str`` no longer defaults to ``''``, ``fields.Int`` no longer defaults to ``0``, etc. (:issue:`199`). Thanks :user:`jmcarp` for the feedback. 1779- In ``strict`` mode, a ``ValidationError`` is raised. Error messages are accessed via the ``ValidationError's`` ``messages`` attribute (:issue:`128`). 1780- Add ``allow_none`` parameter to ``fields.Field``. If ``False`` (the default), validation fails when the field's value is ``None`` (:issue:`76`, :issue:`111`). If ``allow_none`` is ``True``, ``None`` is considered valid and will deserialize to ``None``. 1781- Schema-level validators can store error messages for multiple fields (:issue:`118`). Thanks :user:`ksesong` for the suggestion. 1782- Add ``pre_load``, ``post_load``, ``pre_dump``, and ``post_dump`` Schema method decorators for defining pre- and post- processing routines (:issue:`153`, :issue:`179`). Thanks :user:`davidism`, :user:`taion`, and :user:`jmcarp` for the suggestions and feedback. Thanks :user:`taion` for the implementation. 1783- Error message for ``required`` validation is configurable. (:issue:`78`). Thanks :user:`svenstaro` for the suggestion. Thanks :user:`0xDCA` for the implementation. 1784- Add ``load_from`` parameter to fields (:issue:`125`). Thanks :user:`hakjoon`. 1785- Add ``load_only`` and ``dump_only`` parameters to fields (:issue:`61`, :issue:`87`). Thanks :user:`philtay`. 1786- Add `missing` parameter to fields (:issue:`115`). Thanks :user:`philtay`. 1787- Schema validators can take an optional ``raw_data`` argument which contains raw input data, incl. data not specified in the schema (:issue:`127`). Thanks :user:`ryanlowe0`. 1788- Add ``validate.OneOf`` (:issue:`135`) and ``validate.ContainsOnly`` (:issue:`149`) validators. Thanks :user:`philtay`. 1789- Error messages for validators can be interpolated with `{input}` and other values (depending on the validator). 1790- ``fields.TimeDelta`` always serializes to an integer value in order to avoid rounding errors (:issue:`105`). Thanks :user:`philtay`. 1791- Add ``include`` class Meta option to support field names which are Python keywords (:issue:`139`). Thanks :user:`nickretallack` for the suggestion. 1792- ``exclude`` parameter is respected when used together with ``only`` parameter (:issue:`165`). Thanks :user:`lustdante` for the catch and patch. 1793- ``fields.List`` works as expected with generators and sets (:issue:`185`). Thanks :user:`sergey-aganezov-jr`. 1794 1795Deprecation/Removals: 1796 1797- ``MarshallingError`` and ``UnmarshallingError`` error are deprecated in favor of a single ``ValidationError`` (:issue:`160`). 1798- ``context`` argument passed to Method fields is deprecated. Use ``self.context`` instead (:issue:`184`). 1799- Remove ``ForcedError``. 1800- Remove support for generator functions that yield validators (:issue:`74`). Plain generators of validators are still supported. 1801- The ``Select/Enum`` field is deprecated in favor of using ``validate.OneOf`` validator (:issue:`135`). 1802- Remove legacy, pre-1.0 API (``Schema.data`` and ``Schema.errors`` properties) (:issue:`73`). 1803- Remove ``null`` value. 1804 1805Other changes: 1806 1807- ``Marshaller``, ``Unmarshaller`` were moved to ``marshmallow.marshalling``. These should be considered private API (:issue:`129`). 1808- Make ``allow_null=True`` the default for ``Nested`` fields. This will make ``None`` serialize to ``None`` rather than a dictionary with empty values (:issue:`132`). Thanks :user:`nickrellack` for the suggestion. 1809 18101.2.6 (2015-05-03) 1811++++++++++++++++++ 1812 1813Bug fixes: 1814 1815- Fix validation error message for ``fields.Decimal``. 1816- Allow error message for ``fields.Boolean`` to be customized with the ``error`` parameter (like other fields). 1817 18181.2.5 (2015-04-25) 1819++++++++++++++++++ 1820 1821Bug fixes: 1822 1823- Fix validation of invalid types passed to a ``Nested`` field when ``many=True`` (:issue:`188`). Thanks :user:`juanrossi` for reporting. 1824 1825Support: 1826 1827- Fix pep8 dev dependency for flake8. Thanks :user:`taion`. 1828 18291.2.4 (2015-03-22) 1830++++++++++++++++++ 1831 1832Bug fixes: 1833 1834- Fix behavior of ``as_string`` on ``fields.Integer`` (:issue:`173`). Thanks :user:`taion` for the catch and patch. 1835 1836Other changes: 1837 1838- Remove dead code from ``fields.Field``. Thanks :user:`taion`. 1839 1840Support: 1841 1842- Correction to ``_postprocess`` method in docs. Thanks again :user:`taion`. 1843 18441.2.3 (2015-03-15) 1845++++++++++++++++++ 1846 1847Bug fixes: 1848 1849- Fix inheritance of ``ordered`` class Meta option (:issue:`162`). Thanks :user:`stephenfin` for reporting. 1850 18511.2.2 (2015-02-23) 1852++++++++++++++++++ 1853 1854Bug fixes: 1855 1856- Fix behavior of ``skip_missing`` and ``accessor`` options when ``many=True`` (:issue:`137`). Thanks :user:`3rdcycle`. 1857- Fix bug that could cause an ``AttributeError`` when nesting schemas with schema-level validators (:issue:`144`). Thanks :user:`vovanbo` for reporting. 1858 18591.2.1 (2015-01-11) 1860++++++++++++++++++ 1861 1862Bug fixes: 1863 1864- A ``Schema's`` ``error_handler``--if defined--will execute if ``Schema.validate`` returns validation errors (:issue:`121`). 1865- Deserializing `None` returns `None` rather than raising an ``AttributeError`` (:issue:`123`). Thanks :user:`RealSalmon` for the catch and patch. 1866 18671.2.0 (2014-12-22) 1868++++++++++++++++++ 1869 1870Features: 1871 1872- Add ``QuerySelect`` and ``QuerySelectList`` fields (:issue:`84`). 1873- Convert validators in ``marshmallow.validate`` into class-based callables to make them easier to use when declaring fields (:issue:`85`). 1874- Add ``Decimal`` field which is safe to use when dealing with precise numbers (:issue:`86`). 1875 1876Thanks :user:`philtay` for these contributions. 1877 1878Bug fixes: 1879 1880- ``Date`` fields correctly deserializes to a ``datetime.date`` object when ``python-dateutil`` is not installed (:issue:`79`). Thanks :user:`malexer` for the catch and patch. 1881- Fix bug that raised an ``AttributeError`` when using a class-based validator. 1882- Fix ``as_string`` behavior of Number fields when serializing to default value. 1883- Deserializing ``None`` or the empty string with either a ``DateTime``, ``Date``, ``Time`` or ``TimeDelta`` results in the correct unmarshalling errors (:issue:`96`). Thanks :user:`svenstaro` for reporting and helping with this. 1884- Fix error handling when deserializing invalid UUIDs (:issue:`106`). Thanks :user:`vesauimonen` for the catch and patch. 1885- ``Schema.loads`` correctly defaults to use the value of ``self.many`` rather than defaulting to ``False`` (:issue:`108`). Thanks :user:`davidism` for the catch and patch. 1886- Validators, data handlers, and preprocessors are no longer shared between schema subclasses (:issue:`88`). Thanks :user:`amikholap` for reporting. 1887- Fix error handling when passing a ``dict`` or ``list`` to a ``ValidationError`` (:issue:`110`). Thanks :user:`ksesong` for reporting. 1888 1889Deprecation: 1890 1891- The validator functions in the ``validate`` module are deprecated in favor of the class-based validators (:issue:`85`). 1892- The ``Arbitrary``, ``Price``, and ``Fixed`` fields are deprecated in favor of the ``Decimal`` field (:issue:`86`). 1893 1894Support: 1895 1896- Update docs theme. 1897- Update contributing docs (:issue:`77`). 1898- Fix namespacing example in "Extending Schema" docs. Thanks :user:`Ch00k`. 1899- Exclude virtualenv directories from syntax checking (:issue:`99`). Thanks :user:`svenstaro`. 1900 1901 19021.1.0 (2014-12-02) 1903++++++++++++++++++ 1904 1905Features: 1906 1907- Add ``Schema.validate`` method which validates input data against a schema. Similar to ``Schema.load``, but does not call ``make_object`` and only returns the errors dictionary. 1908- Add several validation functions to the ``validate`` module. Thanks :user:`philtay`. 1909- Store field name and instance on exceptions raised in ``strict`` mode. 1910 1911Bug fixes: 1912 1913- Fix serializing dictionaries when field names are methods of ``dict`` (e.g. ``"items"``). Thanks :user:`rozenm` for reporting. 1914- If a Nested field is passed ``many=True``, ``None`` serializes to an empty list. Thanks :user:`nickretallack` for reporting. 1915- Fix behavior of ``many`` argument passed to ``dump`` and ``load``. Thanks :user:`svenstaro` for reporting and helping with this. 1916- Fix ``skip_missing`` behavior for ``String`` and ``List`` fields. Thanks :user:`malexer` for reporting. 1917- Fix compatibility with python-dateutil 2.3. 1918- More consistent error messages across ``DateTime``, ``TimeDelta``, ``Date``, and ``Time`` fields. 1919 1920Support: 1921 1922- Update Flask and Peewee examples. 1923 19241.0.1 (2014-11-18) 1925++++++++++++++++++ 1926 1927Hotfix release. 1928 1929- Ensure that errors dictionary is correctly cleared on each call to ``Schema.dump`` and ``Schema.load``. 1930 19311.0.0 (2014-11-16) 1932++++++++++++++++++ 1933 1934Adds new features, speed improvements, better error handling, and updated documentation. 1935 1936- Add ``skip_missing`` ``class Meta`` option. 1937- A field's ``default`` may be a callable. 1938- Allow accessor function to be configured via the ``Schema.accessor`` decorator or the ``__accessor__`` class member. 1939- ``URL`` and ``Email`` fields are validated upon serialization. 1940- ``dump`` and ``load`` can receive the ``many`` argument. 1941- Move a number of utility functions from fields.py to utils.py. 1942- More useful ``repr`` for ``Field`` classes. 1943- If a field's default is ``fields.missing`` and its serialized value is ``None``, it will not be included in the final serialized result. 1944- Schema.dumps no longer coerces its result to a binary string on Python 3. 1945- *Backwards-incompatible*: Schema output is no longer an ``OrderedDict`` by default. If you want ordered field output, you must explicitly set the ``ordered`` option to ``True``. 1946- *Backwards-incompatible*: ``error`` parameter of the ``Field`` constructor is deprecated. Raise a ``ValidationError`` instead. 1947- Expanded test coverage. 1948- Updated docs. 1949 19501.0.0-a (2014-10-19) 1951++++++++++++++++++++ 1952 1953Major reworking and simplification of the public API, centered around support for deserialization, improved validation, and a less stateful ``Schema`` class. 1954 1955* Rename ``Serializer`` to ``Schema``. 1956* Support for deserialization. 1957* Use the ``Schema.dump`` and ``Schema.load`` methods for serializing and deserializing, respectively. 1958* *Backwards-incompatible*: Remove ``Serializer.json`` and ``Serializer.to_json``. Use ``Schema.dumps`` instead. 1959* Reworked fields interface. 1960* *Backwards-incompatible*: ``Field`` classes implement ``_serialize`` and ``_deserialize`` methods. ``serialize`` and ``deserialize`` comprise the public API for a ``Field``. ``Field.format`` and ``Field.output`` have been removed. 1961* Add ``exceptions.ForcedError`` which allows errors to be raised during serialization (instead of storing errors in the ``errors`` dict). 1962* *Backwards-incompatible*: ``DateTime`` field serializes to ISO8601 format by default (instead of RFC822). 1963* *Backwards-incompatible*: Remove ``Serializer.factory`` method. It is no longer necessary with the ``dump`` method. 1964* *Backwards-incompatible*: Allow nesting a serializer within itself recursively. Use ``exclude`` or ``only`` to prevent infinite recursion. 1965* *Backwards-incompatible*: Multiple errors can be stored for a single field. The errors dictionary returned by ``load`` and ``dump`` have lists of error messages keyed by field name. 1966* Remove ``validated`` decorator. Validation occurs within ``Field`` methods. 1967* ``Function`` field raises a ``ValueError`` if an uncallable object is passed to its constructor. 1968* ``Nested`` fields inherit context from their parent. 1969* Add ``Schema.preprocessor`` and ``Schema.validator`` decorators for registering preprocessing and schema-level validation functions respectively. 1970* Custom error messages can be specified by raising a ``ValidationError`` within a validation function. 1971* Extra keyword arguments passed to a Field are stored as metadata. 1972* Fix ordering of field output. 1973* Fix behavior of the ``required`` parameter on ``Nested`` fields. 1974* Fix serializing keyed tuple types (e.g. ``namedtuple``) with ``class Meta`` options. 1975* Fix default value for ``Fixed`` and ``Price`` fields. 1976* Fix serialization of binary strings. 1977* ``Schemas`` can inherit fields from non-``Schema`` base classes (e.g. mixins). Also, fields are inherited according to the MRO (rather than recursing over base classes). Thanks :user:`jmcarp`. 1978* Add ``Str``, ``Bool``, and ``Int`` field class aliases. 1979 19800.7.0 (2014-06-22) 1981++++++++++++++++++ 1982 1983* Add ``Serializer.error_handler`` decorator that registers a custom error handler. 1984* Add ``Serializer.data_handler`` decorator that registers data post-processing callbacks. 1985* *Backwards-incompatible*: ``process_data`` method is deprecated. Use the ``data_handler`` decorator instead. 1986* Fix bug that raised error when passing ``extra`` data together with ``many=True``. Thanks :user:`buttsicles` for reporting. 1987* If ``required=True`` validation is violated for a given ``Field``, it will raise an error message that is different from the message specified by the ``error`` argument. Thanks :user:`asteinlein`. 1988* More generic error message raised when required field is missing. 1989* ``validated`` decorator should only wrap a ``Field`` class's ``output`` method. 1990 19910.6.0 (2014-06-03) 1992++++++++++++++++++ 1993 1994* Fix bug in serializing keyed tuple types, e.g. ``namedtuple`` and ``KeyedTuple``. 1995* Nested field can load a serializer by its class name as a string. This makes it easier to implement 2-way nesting. 1996* Make ``Serializer.data`` override-able. 1997 19980.5.5 (2014-05-02) 1999++++++++++++++++++ 2000 2001* Add ``Serializer.factory`` for creating a factory function that returns a Serializer instance. 2002* ``MarshallingError`` stores its underlying exception as an instance variable. This is useful for inspecting errors. 2003* ``fields.Select`` is aliased to ``fields.Enum``. 2004* Add ``fields.__all__`` and ``marshmallow.__all__`` so that the modules can be more easily extended. 2005* Expose ``Serializer.OPTIONS_CLASS`` as a class variable so that options defaults can be overridden. 2006* Add ``Serializer.process_data`` hook that allows subclasses to manipulate the final output data. 2007 20080.5.4 (2014-04-17) 2009++++++++++++++++++ 2010 2011* Add ``json_module`` class Meta option. 2012* Add ``required`` option to fields . Thanks :user:`DeaconDesperado`. 2013* Tested on Python 3.4 and PyPy. 2014 20150.5.3 (2014-03-02) 2016++++++++++++++++++ 2017 2018* Fix ``Integer`` field default. It is now ``0`` instead of ``0.0``. Thanks :user:`kalasjocke`. 2019* Add ``context`` param to ``Serializer``. Allows accessing arbitrary objects in ``Function`` and ``Method`` fields. 2020* ``Function`` and ``Method`` fields raise ``MarshallingError`` if their argument is uncallable. 2021 2022 20230.5.2 (2014-02-10) 2024++++++++++++++++++ 2025 2026* Enable custom field validation via the ``validate`` parameter. 2027* Add ``utils.from_rfc`` for parsing RFC datestring to Python datetime object. 2028 20290.5.1 (2014-02-02) 2030++++++++++++++++++ 2031 2032* Avoid unnecessary attribute access in ``utils.to_marshallable_type`` for improved performance. 2033* Fix RFC822 formatting for localized datetimes. 2034 20350.5.0 (2013-12-29) 2036++++++++++++++++++ 2037 2038* Can customize validation error messages by passing the ``error`` parameter to a field. 2039* *Backwards-incompatible*: Rename ``fields.NumberField`` -> ``fields.Number``. 2040* Add ``fields.Select``. Thanks :user:`ecarreras`. 2041* Support nesting a Serializer within itself by passing ``"self"`` into ``fields.Nested`` (only up to depth=1). 2042* *Backwards-incompatible*: No implicit serializing of collections. Must set ``many=True`` if serializing to a list. This ensures that marshmallow handles singular objects correctly, even if they are iterable. 2043* If Nested field ``only`` parameter is a field name, only return a single value for the nested object (instead of a dict) or a flat list of values. 2044* Improved performance and stability. 2045 20460.4.1 (2013-12-01) 2047++++++++++++++++++ 2048 2049* An object's ``__marshallable__`` method, if defined, takes precedence over ``__getitem__``. 2050* Generator expressions can be passed to a serializer. 2051* Better support for serializing list-like collections (e.g. ORM querysets). 2052* Other minor bugfixes. 2053 20540.4.0 (2013-11-24) 2055++++++++++++++++++ 2056 2057* Add ``additional`` `class Meta` option. 2058* Add ``dateformat`` `class Meta` option. 2059* Support for serializing UUID, date, time, and timedelta objects. 2060* Remove ``Serializer.to_data`` method. Just use ``Serialize.data`` property. 2061* String field defaults to empty string instead of ``None``. 2062* *Backwards-incompatible*: ``isoformat`` and ``rfcformat`` functions moved to utils.py. 2063* *Backwards-incompatible*: Validation functions moved to validate.py. 2064* *Backwards-incompatible*: Remove types.py. 2065* Reorder parameters to ``DateTime`` field (first parameter is dateformat). 2066* Ensure that ``to_json`` returns bytestrings. 2067* Fix bug with including an object property in ``fields`` Meta option. 2068* Fix bug with passing ``None`` to a serializer. 2069 20700.3.1 (2013-11-16) 2071++++++++++++++++++ 2072 2073* Fix bug with serializing dictionaries. 2074* Fix error raised when serializing empty list. 2075* Add ``only`` and ``exclude`` parameters to Serializer constructor. 2076* Add ``strict`` parameter and option: causes Serializer to raise an error if invalid data are passed in, rather than storing errors. 2077* Updated Flask + SQLA example in docs. 2078 20790.3.0 (2013-11-14) 2080++++++++++++++++++ 2081 2082* Declaring Serializers just got easier. The ``class Meta`` paradigm allows you to specify fields more concisely. Can specify ``fields`` and ``exclude`` options. 2083* Allow date formats to be changed by passing ``format`` parameter to ``DateTime`` field constructor. Can either be ``"rfc"`` (default), ``"iso"``, or a date format string. 2084* More useful error message when declaring fields as classes (instead of an instance, which is the correct usage). 2085* Rename ``MarshallingException`` -> ``MarshallingError``. 2086* Rename ``marshmallow.core`` -> ``marshmallow.serializer``. 2087 20880.2.1 (2013-11-12) 2089++++++++++++++++++ 2090 2091* Allow prefixing field names. 2092* Fix storing errors on Nested Serializers. 2093* Python 2.6 support. 2094 20950.2.0 (2013-11-11) 2096++++++++++++++++++ 2097 2098* Field-level validation. 2099* Add ``fields.Method``. 2100* Add ``fields.Function``. 2101* Allow binding of extra data to a serialized object by passing the ``extra`` param when initializing a ``Serializer``. 2102* Add ``relative`` paramater to ``fields.Url`` that allows for relative URLs. 2103 21040.1.0 (2013-11-10) 2105++++++++++++++++++ 2106 2107* First release. 2108