-----------
Released on May 10, 2018.
.. note::
Make sure you read the :ref:`Breaking Changes <breaking_changes>` section below.
- New: support for `partial media requests`_. Clients can request partial file
downloads by adding a ``Range`` header to their media request (`1050`_).
- New: `Renderer classes`_. ``RENDERER`` allows to change enabled renderers.
Defaults to ``['eve.render.JSONRenderer', 'eve.render.XMLRenderer']``. You
can create your own renderer by subclassing ``eve.render.Renderer``. Each
renderer should set valid mime attr and have ``.render()`` method
implemented. Please note that at least one renderer must always be enabled
(`1092`_).
- New: ``on_delete_resource_originals`` fired when soft deletion occurs
(`1030`_).
- New: ``before_aggregation`` and ``after_aggregation`` event hooks allow to
attach `custom callbacks to aggregation endpoints`_ (`1057`_).
- New: ``JSON_REQUEST_CONTENT_TYPES`` or supported JSON content types. Useful
when you need support for vendor-specific json types. Please note: responses
will still carry the standard ``application/json`` type. Defaults to
``['application/json']`` (`1024`_).
- New: when the media endpoint is enabled, the default authentication class
will be used to secure it. (`1083`_; `1049`_).
- New: ``MERGE_NESTED_DOCUMENTS``. If ``True``, updates to nested fields are
merged with the current data on ``PATCH``. If ``False``, the updates
overwrite the current data. Defaults to ``True`` (`1140`_).
- New: support for MongoDB decimal type ``bson.decimal128.Decimal128``
(`1045`_).
- New: Support for ``Feature`` and ``FeatureCollection`` GeoJSON objects
(`769`_).
- New: Add support for MongoDB ``$box`` geo query operator (`1122`_).
- New: ``ALLOW_CUSTOM_FIELDS_IN_GEOJSON`` allows custom fields in GeoJSON
(`1004`_).
- New: Add support for MongoDB ``$caseSensitive`` and ``$diactricSensitive``
query operators (`1126`_).
- New: Add support for MongoDB bitwise query operators ``$bitsAllClear``,
``$bitsAllSet``, ``$bitsAnyClear``, ``$bitsAnySet`` (`1053`_).
- New: support for ``MONGO_AUTH_MECHANISM`` and
``MONGO_AUTH_MECHANISM_PROPERTIES``.
- New: ``MONGO_DBNAME`` can now be used in conjuction with ``MONGO_URI``.
Previously, if ``MONGO_URI`` was missing the database name, an exception
would be rised (`1037`_).
- Fix: OPLOG skipped even if ``OPLOG = True`` (`1074`_).
- Fix: Cannot define default projection and request specific field. (`1036`_).
- Fix: ``VALIDATE_FILTERS`` and ``ALLOWED_FILTERS`` do not work with
sub-document fields. (`1123`_).
- Fix: Aggregation query parameter does not replace keys in the lists
(`1025`_).
- Fix: serialization bug that randomly skips fields if "x_of" is encountered
(`1042`_)
- Fix: PUT behavior with User Restricted Resource Access. Ensure that, under
every circumstance, users are unable to overwrite items owned by other users
(`1130`_).
- Fix: Crash with Cerberus 1.2 (`1137`_).
- Fix documentation typos (`1114`_, `1102`_)
- Fix: broken documentation links to Cerberus validation rules.
- Fix: add sphinxcontrib-embedly to dev-requirements.txt.
- Fix: Removed OrderedDict dependency; use ``OrderedDict`` from
``backport_collections`` instead (`1070`_).
- Performance improved on retrieving a list of embedded documents (`1029`_).
- Dev: Refactor index creation. We now have a new
``eve.io.mongo.ensure_mongo_indexes()`` function which ensures that eventual
``mongo_indexes`` defined for a resource are created on the active database.
The function can be imported and invoked, for example in multi-db workflows
where a db is activated based on the authenticated user performing the
request (via custom auth classes).
- Dev: Add a `Makefile with shortcuts`_ for testing, docs building, and
development install.
- Dev: Switch to pytest as the standard testing tool.
- Dev: Drop ``requiments.txt`` and ``dev-requirements.txt``. Use ``pip install
-e .[dev|tests|docs]`` instead.
- Tests: finally acknowledge the existence of modern APIs for both Mongo and
Python (get rid of most deprecation warnings).
- Change: Support for Cerberus 1.0+ (`776`_).
- Change: ``JSON`` and ``XML`` settings are deprecated and will be removed in
a future update. Use ``RENDERERS`` instead (`1092`_).
- Flask dependency set to >=1.0 (`1111`_).
- PyMongo dependency set to >=3.5.
- Events dependency set to >=v0.3.
- Drop Flask-PyMongo dependency, use custom code instead (`855`_).
- Docs: Comprehensive rewrite of the `How to contribute`_ page.
- Docs: Drop the testing page; merge its contents with `How to contribute`_.
- Docs: Add link to the `Eve course`_. It was authored by the project author,
and it is hosted by TalkPython Training.
- Docs: code snippets are now Python 3 compatibile (Pahaz Blinov).
- Dev: Delete and cleanup of some unnecessary code.
- Dev: after the latest update (May 4th) travis-ci would not run tests on
Python 2.6.
- Dev: all branches are now tested on travis-ci. Previously, only 'master' was
being tested.
- Dev: fix insidious bug in ``tests.methods.post.TestPost`` class.
.. _breaking_changes:
Breaking Changes
~~~~~~~~~~~~~~~~
- Python 2.6 and Python 3.3 are no longer supported (`1129`_).
- Eve now relies on `Cerberus`_ 1.1+ (`776`_). It allows for many new
powerful validation and trasformation features (like `schema registries`_),
improved performance and, in general, a more streamlined API. It also brings
some notable breaking changes.
- ``keyschema`` was renamed to ``valueschema``, and ``propertyschema`` to
``keyschema``.
- A PATCH on a document which misses a field having a default value will
now result in setting this value, even if the field was not provided in
the PATCH's payload.
- Error messages for ``keyschema`` are now returned as dictionary. Example:
``{'a_dict': {'a_field': "value does not match regex '[a-z]+'"}}``.
- Error messages for type validations are `different now`_.
- It is no longer valid to have a field with ``default = None`` and
``nullable = False`` (see
*patch.py:test_patch_nested_document_nullable_missing*).
- And more. A complete list of breaking changes is available here_. For
detailed upgrade instructions, see Cerberus `upgrade notes`_. An in-depth
analysis of changes made to the codebase (useful if you wrote a custom
validator which needs to be upgraded) is available with `this commit
message`_.
- Special thanks to Dominik Kellner and Brad P. Crochet for the amazing job
done on this upgrade.
- Config setting ``MONGO_AUTHDBNAME`` renamed into ``MONGO_AUTH_SOURCE`` for
naming consistency with PyMongo.
- Config options ``MONGO_MAX_POOL_SIZE``, ``MONGO_SOCKET_TIMEOUT_MS``,
``MONGO_CONNECT_TIMEOUT_MS``, ``MONGO_REPLICA_SET``,
``MONGO_READ_PREFERENCE`` removed. Use ``MONGO_OPTIONS`` or ``MONGO_URI``
instead.
- Be aware that ``DELETE`` on sub-resource endpoint will now only delete the
documents matching endpoint semantics. A delete operation on
``people/51f63e0838345b6dcd7eabff/invoices`` will delete all documents
matching the followig query: ``{'contact_id': '51f63e0838345b6dcd7eabff'}``
(`1010`_).
.. _1140: https://github.com/pyeve/eve/pull/1140
.. _1111: https://github.com/pyeve/eve/issues/1111
.. _1129: https://github.com/pyeve/eve/issues/1129
.. _1057: https://github.com/pyeve/eve/issues/1057
.. _1137: https://github.com/pyeve/eve/issues/1137
.. _1122: https://github.com/pyeve/eve/issues/1122
.. _1050: https://github.com/pyeve/eve/pull/1050
.. _1130: https://github.com/pyeve/eve/pull/1130
.. _1074: https://github.com/pyeve/eve/issues/1074
.. _1036: https://github.com/pyeve/eve/issues/1036
.. _1128: https://github.com/pyeve/eve/pull/1128
.. _1126: https://github.com/pyeve/eve/pull/1126
.. _1123: https://github.com/pyeve/eve/issues/1123
.. _1102: https://github.com/pyeve/eve/pull/1102
.. _1114: https://github.com/pyeve/eve/pull/1114
.. _1092: https://github.com/pyeve/eve/pull/1092
.. _1083: https://github.com/pyeve/eve/issues/1083
.. _1049: https://github.com/pyeve/eve/issues/1049
.. _1053: https://github.com/pyeve/eve/issues/1053
.. _1070: https://github.com/pyeve/eve/pull/1070
.. _1045: https://github.com/pyeve/eve/issues/1045
.. _1042: https://github.com/pyeve/eve/pull/1042
.. _1030: https://github.com/pyeve/eve/pull/1030
.. _1037: https://github.com/pyeve/eve/issues/1037
.. _1029: https://github.com/pyeve/eve/issues/1029
.. _1024: https://github.com/pyeve/eve/issues/1024
.. _769: https://github.com/pyeve/eve/issues/769
.. _1004: https://github.com/pyeve/eve/issues/1004
.. _776: https://github.com/pyeve/eve/issues/776
.. _855: https://github.com/pyeve/eve/issues/855
.. _1010: https://github.com/pyeve/eve/issues/1010
.. _1025: https://github.com/pyeve/eve/issues/1025
.. _Cerberus: http://python-cerberus.org
.. _`schema registries`: http://docs.python-cerberus.org/en/stable/schemas.html#registries
.. _`different now`: http://docs.python-cerberus.org/en/stable/upgrading.html#data-types
.. _here: http://docs.python-cerberus.org/en/stable/changelog.html#breaking-changes
.. _`upgrade notes`: http://python-cerberus.org/en/stable/upgrading.html
.. _`this commit message`: https://github.com/pyeve/eve/pull/1001/commits/1110f807b478efa9f13ad1d217d22ceaa2a9e42d
.. _`partial media requests`: http://python-eve.org/features.html#partial-media-downloads
.. _`custom callbacks to aggregation endpoints`: http://python-eve.org/features.html#aggregation-event-hooks
.. _`Renderer classes`: http://python-eve.org/features.html#rendering
.. _`makefile with shortcuts`: http://python-eve.org/contributing.html#make-targets
.. _`How to contribute`: http://python-eve.org/contributing.html
.. _`Eve course`: https://training.talkpython.fm/courses/explore_eve/eve-building-restful-mongodb-backed-apis-course