-
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
New version JSON API (version 1.1) #425
Comments
Thanks for pointing this out @JPBergsma, I've just read through the changelog and would be happy to present these highlights at the next meeting this week. Some highlights of the 1.1 release that may be of interest:
In terms of where we are currently non-compliant with v1.0 (see discussion at #420), v1.1 could perhaps allow us to tackle this with profiles. |
Yes, this seems to be a rather big change compared to the previous version. So we may even have to wait until version 2.0 before we can adopt JSON API 1.1 . |
@ml-evs I was looking over these and wondering if we need to define "optimade:"-prefixed versions of our query parameters and deprecate the old ones. As best I can understand the JSON:API specification, there are four levels of "decreasing power" in what they are allowed to do:
Profiles cannot define new query parameters. Extensions can, but only on the format https://jsonapi.org/format/#query-parameters-custom Do we want to make OPTIMADE an "extension" of JSON:API, or are we happy it is 'merely' an "implementation" (whatever that distinction means...) We could say that one is allowed to prefix all our parameters with "optimade:" in prepration of making OPTIMADE v2.0.0 an JSON:API extension. But, is there a reason to bother about this? I cannot say that I very much like the idea of extending the length of our query strings by a bunch of unnecessary "optimade:"... |
Also, could you clarify how Profiles could help the issue in #408 ? We have always been able to add top level fields with underscores. I thought the issue was that the outermost data structure in a JSON:API response is a dictionary that is "unsorted" and thus (in most implementations dealing with JSON data), even with an "optimade_" field, there is no way to ensure that it appears in the, say, first 10 kb of data. (This IMO is a fairly major flaw with JSON:API that they won't be able to repair without a backwards-breaking change. The outermost data structure should have been a list, with the first element containing the meta dictionary.) |
I hadn't appreciated this; assumed this would be breaking for JSON:API 1.0 (I never checked this closely though).
This is still the main issue, yes. I'm not sure this stops us mandating amongst ourselves that it will be the first key in the response; if up until now clients have not been able to rely on the order of keys from the server, enforcing one now doesn't seem like a huge deal, especially as it is just an annotation. Presumably this only adds the constraint that the transport of the JSON itself should not change the order? |
I have been thinking that what I said above was true based on early OPTIMADE discussions when we changed over to JSON:API, but looking more carefully at the standard text now, I think you are right and I am wrong about this: in v1.0 this "rule" is about implementation-specific query parameters, not members. With that said, for v1.0 there is another top-level key that seems intended for this kind of info:
It could be a suggestion, but is that worth anything if implementations cannot rely on it to identify the file format? Implementation-wise it seems easy but ugly to do, though (hack the string output from your json library to inject the key at the top...) |
I'm looking at the JSON:API v1.1 question again as I am trying to synchronize our work on property definitions in #445 with the intent to be able to use @-members for json-ld in the future. The feature of generally allowing @ members anywhere in v1.1 would hence be useful. I think all is ok if we just update the reference to JSON:API to v1.1 since it is meant to be forward compatible; perhaps with the clarification that OPTIMADE is a specification that adds requirements onto JSON:API on "implementation level", i.e., it is not a Profile, nor an Extension. As was discussed above, on implementation level our query parameters seems fine per https://jsonapi.org/format/1.1/#query-parameters-custom |
I think this was closed by #461 -- we didn't end up couching any of our additions in terms of the JSON:API v1.1 features but I think we're still somewhat compatible |
I noticed that a new version of the JSON API is out, version 1.1.
Do we want to update the OPTIMADE specification to be compatible with this version ?
I have not read it in detail, so I do not know if there are things we would need to change.
The text was updated successfully, but these errors were encountered: