Comments (5)
Hello and thank you for your comments. Both are actually design decisions taken to minimize payload size, which is an important factor when dealing with possibly unpredictable connections (think mobile).
If you're on a collection endpoint, by definition you already know the documents parent (you're on it). Besides, that piece of information is actually in the payload already (the "self" link in _items
). Repeating that link for every document in the payload seems like an optimization waste. Consider that there could be hundreds (or even thousands) duplicates in case the API maintainer, for some obscure reason, decides to turn pagination off.
For the same reason the etag is not duplicated at the item endpoint. It's in the header already, you don't probably need that piece of information twice within the same payload. At collection endpoint we're forced to serve individual etags since we want to allow for subsequent direct conditional requests (If-Match
) on individual documents, without forcing a previous document lookup. For coherence however, it would probably be reasonable to add the etag in the json/xml stream too, as in this case the 'waste' would be pretty much insignificant. Let's see what/if others have something to say on this point.
from eve.
Nicola, I understand and see the validity of your point about minimising payload size, and about the duplicated data inside the payload. For the etag though, as you mention, it would make sense to be in the payload (as well the HTTP header). In other words, forget about point 1 and keep point 2.
from eve.
What if this 'choerence mode' is disabled by default but you can switch it on with a global setting, something like a COHERENCE_MODE
boolean?
from eve.
That would totally do it, of course ;-)
from eve.
Screw the COHERENCE_MODE
we'll just throw the ETag in the payload instead. :)
from eve.
Related Issues (20)
- Is there a way to get jsonschema using the API? HOT 1
- Issue with query_objectid_as_string on Eve>=1.0.1 HOT 7
- Release HOT 1
- 422 UNPROCESSABLE ENTITY when using user_id and data_relation on PATCH HOT 1
- Render fails because recent version of Werkzeug has removed escape() method from utils HOT 6
- HATEOAS links are relative starting with Werkzeug 2.1; should be absolute for backward compatibility HOT 1
- Werkzeug utils has no attribute escape. HOT 1
- MongoDB auth related issue in MONGO_URI HOT 10
- Add support to release Linux aarch64 wheels HOT 2
- deleteitem_internal on media resource, KeyError: 'media'
- Tests fail with Flask 2.2 HOT 2
- etag generation fails if 'uuidRepresentation' is not set in MONGO_OPTIONS HOT 1
- Malformed Last Updated field HOT 7
- How to get in touch regarding a security concern HOT 1
- [Feature Request] One document Endpoint HOT 1
- pass var to a pipeline aggregation via url and regex HOT 1
- Replace vs Merge Update on PATCH
- CI failure: `mongo command not found` on ubuntu-latest (22.04)
- Tests folder in eve distribution HOT 3
- Type serialization does not work inside valuesrules or valueschema
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eve.