-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate data and metadata in records. #256
Comments
Very related to #174 |
Actually what I understand of your proposal, taking care of @leplatrem concerns, is to rather do:
So adding a new level to put all records data in it. Then the collection_get will look like :
The question is, will permission be part of this data or not?
or
|
If we go furthermore in the proposal and look at collections, will it look like that:
or like that?
Depending of if we consider the schema being part of the collection attributes (that we want to take into account when signing the collection object). |
If we want to get closer to what jsonapi is doing, it should probably look like this:
|
From what I understand I guess it should. Like
In terms of implementation, this would probably mean to get rid of the multiple backends and put everything into one. Otherwise, joining data and permissions during the list construction might not be efficient at all. Especially if we want stuff like #123
As I said privately, this could be quite a change for the whole ecosystem, and I see no emergency in doing this. I personally would rather keep metadata mixed up with data and put the efforts into other challenges that bring more value to the end users (docs, install, demos, integrity, ...) |
@Natim I don't understand what we get by having two different levels of "data" (or data/attributes). Having data alongside the other metadata (last modified etc) seems cleaner to me. Permissions, schema etc should go alongside the rest. Eg. {
'id': '1234',
'last_modified': 123456,
'data': {'foo': 'bar'},
'permissions': {},
'schema': 'blah'
} |
I'm very much in favour of the proposal by @almet. I only just recently came across kinto but already thinking of things I could do with it. One question I have, related to the kinto-attachment plugin, would this proposal if implemented add the On a side note, has anyone proposed a related records plugin? In my mind, it would add the key
Again, this would feel nice if added as metadata alongside id, ... |
Let's be realistic. This won't happen |
I'm opening this for discussion in Kinto, but it's entierly possible that it should live in Cliquet instead.
Currently, records have some metadata attributes directly returned alongside the business attributes. These are "id" and "last_modified".
It could make sense to separate these metadata attributes from the data. e.g.
One of the challenges with this approach is that record lists should also contain the associated metadata. I'll let @leplatrem expend on this as I don't see clearly where the problem lies.
Other than that, this change would break the API in an incompatible way, and thus the clients would need to be updated accordingly. Validation features (Schema) and permissions would also be impacted by this approach.
Related to #158
The text was updated successfully, but these errors were encountered: