-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add database
field to meta
for describing the current database
#424
Conversation
beb6e06
to
5672491
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi ml-evs,
I think it is good that we finally have a field to describe the database.
I still have a few small remarks but overall it looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On line 655 there is still an example of a response. I think your database field should be added to this example.
Not sure it's super important, as |
Yes you are right. As it is an optional field it is not so bad that it is not in the example on line 655. |
Suggestion in #422 describes two places where this info can be added: Edit: I made up my mind, I support the current proposal now. |
I agree with Merkys, that it would be sufficient to only place this info only at the info entry point. It is however a bit strange to return the data about the maintainer of the implementation with each response but not the data of the database maintainer. I think it would be best if both were moved to the info endpoint. This may however qualify as a breaking change, so perhaps we should do a major version update before implementing this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For parity with implementation, I think we should also allow to specify a version for the database from which the response comes.
I agree that it make sense to (also?) allow database information in /info, but I can see reasons why people may want it in every response from their database. It isn't many bytes.
Fine by me.
I guess as it stands these fields could also be provided in the We could also consider adding a query parameter that elides the I'll re-request review from everyone now to see if anyone has remaining objections to adding this to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving this - but I think the discussion shows that we have no policy with regards to what should go in the meta field of any response, and what belongs in /info
. The lack of such policy is a problem, because it is going to make us - and our users - unsure where to find stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing my own PR here... I think we should also provide the database id
in the meta of every response. This is another piece of data that is no provided anywhere but in the index meta-database. This can be used to construct globally unique IDs for entries within this database via {provider_prefix}/{database_id}/{entry_id (or immutable_id}
(the provider prefix still needs a call to /info
but at least its accessible from the same base URL).
One missing field other includes link aggregation, but that can probably be omitted here.
a6d33da
to
02a9b25
Compare
Regarding the placement, I noticed that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do still have a preference for moving the description field to the info endpoint, as there is no reason to share it in every response.
As we have however already placed the description for the provider under meta in every response, it seems logical to do the same for the description field of the database.
So for now I will approve this change. But I do think that we should move it for the 2.0 release.
If we are happy with the field names etc here then I think @rartino this is ready for a final review+merge? |
Co-authored-by: Johan Bergsma <29785380+JPBergsma@users.noreply.github.com>
Co-authored-by: Rickard Armiento <gitcommits@armiento.net>
Co-authored-by: Antanas Vaitkus <antanas.vaitkus90@gmail.com>
Co-authored-by: Rickard Armiento <gitcommits@armiento.net>
dc8d474
to
d94c237
Compare
Closes #422.
This PR adds the optional
database
field to allmeta
responses. It can be used to provide the same data on an individual database as that found at the index meta-database, without requiring several requests and potential filtering of the index meta-database response.Only other thought when writing this up is that this info could also be provided as a
self
entry in thelinks
field for every response (though the fields would be limited to just using ameta
field as part of a JSON API Links object).If we prefer this route, then an alternative note could be added to the "JSON Response Schema: Common Fields" section of the spec that reserves the
self
keyword or something similar for this use, the only complication being that JSON:APIself
links should just return the exact URL of the current response.Or one final option is just to add this kind of info at
/info/
directly, and exclude it frommeta
.