-
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
Clarify required fields in a response #250
Comments
Is it possible to elaborate a bit on what is not clear? Your link goes to a single line that does not contain the word SHOULD. Are you referring to "SHOULD NOT" in point 3 of the section 'Entry Listing Endpoints'? That SHOULD NOT means that an API implementation should avoid including properties in the response that are neither marked as REQUIRED nor are included in a supplied
Support tells you when a property is allowed to behave as null or not in queries and as return values. Response tells how the property interacts with the Can you give examples of how you would prefer these to be written into one "thing"? |
I'll try my best to explain, but I'm sure it's going to get convoluted. First, concerning the three categories for the Entry list specific properties:
This seems clear to me: It means a property MUST be present for a resource object in the response, no matter the values given to
The first sentence here is difficult for me to understand - mostly because I cannot seem to properly parse the first part.
This seems clear to me: It means a property that an implementation MUST support, but should be left out of the default response and only included if explicitly requested via This also leaves no room for OPTIONAL properties it seems, since there is no category specified for these. It may be helpful to make a table for these properties, something like this:
So that's part one ... Now it comes to the Entry list of properties.
From the Support requirement I understand that it MUST be in the implementation and cannot be From the table above, the first part of the Support requirement is clear (since there are no OPTIONAL properties allowed) and then it can't be Let's now look at the universal entry property
From the Support requirement I can suddenly understand that it SHOULD be supported by the implementation, i.e., it's essentially OPTIONAL, which is not an allowed category (according to the table and definitions above). Furthermore, it SHOULD NOT be
From the Response requirement I understand that it falls into category 2. Now to a more wholesome part. I think I'm grasping what the intent is with everything, I surely must have been previously, but coming back to it after some time it seems quite unclear to me what is meant when combining all these things. By combining Support and Response or otherwise splitting up Support into what is really meant, it should be clearer. Even better would be to relate it back to the three categories of properties already laid out.
However, I don't like having it say that it is REQUIRED in the implementation, while it MAY be |
I admit that the fuzzy lines are indeed difficult to parse. The meaning of Support and Response in the specification is intended to be orthogonal. Thinking from scratch, there should be two levels of Support:
And three levels of Response:
Or am I missing something? Putting it down this way sounds simple to me. |
Could just as well be
I think that sums up quite neatly my wall of text, yes :) This also means that an implementation should put in all allowed properties somewhere, or retrieve them from the spec, so if they choose not to implement support for an OPTIONAL property, they can still return it in the response - but with the value |
Right.
Same here :) |
You are omitting:
This is different from the present specification in that the latter only RECOMMENDS against including fields in the response that are neither required, nor in Is the distinction between MUST and RECOMMENDED in these two cases useful? It is up to us, but I can definitely argue that most implementations should not break them, but scenarios can be created for when it is motivated. |
This issue has been marked with the v1.0.0 milestone. My personal interpretation is that this is NOT release-blocking and can be moved to the v1.1 milestone, because it is mostly about clarifying what is in the specification (in a way that makes it easier to read). @CasperWA, do you agree? If so, please change the milestone to v1.1. |
When taking into account the spec changes by @merkys in #210 it seems that this can indeed be postponed to v1.1. |
I'm fine with postponing this issue to v1.1. |
Discussing the implementation of #210 in
optimade-python-tools
(PR Materials-Consortia/optimade-python-tools#153) with @ltalirz (and @ml-evs) we have found that it is quite unclear what is meant bySHOULD
in the spec at the moment.Specifically these lines are fuzzy.
We understand the need for certain fields to be "on-request", i.e., only given if explicitly asked for via
response_fields
. As well as having other fields that are REQUIRED in the response at all times, likeid
.We suggest to combine the
**Support**
and**Response**
part of all fields underEntry List
and rewrite the section linked above to be more clear.Tagging @merkys and @rartino here, since they were the main contributors to #210.
The text was updated successfully, but these errors were encountered: