Quantcast
Channel: Planet Python
Viewing all articles
Browse latest Browse all 22462

Eve REST Framework: Eve 0.6 Released

$
0
0

I'm very excited to announce today's release of Eve 0.6. Lots new features and fixes along with a couple breaking changes. Speaking of new features and improvements, some highlights include:

  • Support for multiple databases. Each API endpoint can optionally serve from a different MongoDB instance. See the new mongo_prefix setting.

  • Authentication-driven database access, also known as user-reserved databases.

  • Index maintenance. On MongoDB, indexes can be created/updated at application startup. See the new mongo_indexes keyword.

  • Upserts on PUT. Allows document creation on PUT if the document does not exists. Enabled by default, can be switched off. See the new UPSERT_ON_PUT setting.

  • Soft Deletes, you asked for it.

  • JSONP support. CORS gets support for X-ALLOW-CREDENTIALS too.

  • Serving media files at dedicated endpoint as an alternative to returning them as Base64 strings.

  • Enhanced Logging.

  • A whole set of new, powerful validation rules such as anyof, allof, noneof, oneof, coerce.

  • Support for dot notation in POST, PATCH and PUT methods. Be aware that, for PATCH and PUT, if dot notation is used even on just one field, the whole sub-document will be replaced. So if this document is stored:

    {"name": "john", "location": {"city": "New York", "address": "address"}}

    A PATCH like this:

    {"location.city": "Boston"}

    (which is exactly equivalent to:)

    {"location": {"city": "a nested city"}}

    Will update the document to:

    {"name": "john", "location": {"city": "Boston"}}

Again these are just some highlights but there is a lot more to discover. How about X-Total-Count header for collection GET/HEAD requests, or etag_ignore_field for ignoring certain fields when computing eTags? Make sure you read the whole changelog!

Breaking changes

  • When HATEOAS is off the home endpoint will respond with 200 OK instead of 404 Not Found (also see the new INFO setting which allows exposing of API name and version at the home endpoint).
  • PUT does not return 404 if a document URL does not exist. It will attempt to create the document instead. Set UPSET_ON_PUT to False to disable this behaviour and get a 404 instead.
  • A PATCH including an ID_FIELD field which value is different than the original will get a 400 Bad Request, along with an explanation in the message body that the field is immutable. Previously, it would get an unknown field validation error.

There is also a truckload of closed tickets, fixed and improvements so again, make sure to check the changelog.

Contributors

Cyprien Pannier, Daniel Lytkin, David Wood, Dominik Kellner, Gonéri Le Bouder, Henrique Barroso, Joakim Uddholm, Julian Hille, Kevin Roy, Magdas Adrian, Matthew Ellison, Matthieu Prat, Mayur Dhamanwala, Nick Park, Olivier Carrère, Olivier Poitrey, Pau Freixes, Petr Jašek, Samuli Tuomola, Sebastien Estienne, Stratos Gerakakis, Tobias Betz, xgddsg.

What a team. Thank you all for making this release possibile!

Get Eve 0.6 while it's hot!


Viewing all articles
Browse latest Browse all 22462

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>