Returning null values for required metadata attributes in Federation API #93
Replies: 2 comments
-
Slack conversations related to this discussion: |
Beta Was this translation helpful? Give feedback.
-
There are a few points to consider here. First, on the point of whether we need a sentinel value at all (whether that be In the API, we've taken the philosophy of "if a field is expected and not present, the absence of that field should be explicit to reassure users that the lack of data is not due to a bug in the API or the API being out of date". This is based on best practices of scaling and growing an API into the future. To illustrate the kinds of issues that can occur if we are not explicit in our omission of values, consider the issues that would occur if we decided to simply omit the keys when metadata was missing:
Now, as to the question of what the sentinel value should actually be, the case I would make is a pretty straightforward: the concepts we're wrangling with here are not new, and the designers of the language itself introduced As described by the official JavaScript documentation:
Though one may exist, I cannot think of a compelling reason to contradict the language's chosen strategy here. Further, buying in to the language's type created specifically for this purpose has a few major benefits:
Selecting another other special value, such as
As has been discussed in the conversations on Slack, sometimes tools or dependencies don't properly support the specification: whether that be a third-party library not handling Last, I'd just like to address the idea of
As described by the "Incomplete Data and Nullity" section of the specification, the concept of
Related to this discussion, there was a comment in our discussion last week regarding how |
Beta Was this translation helpful? Give feedback.
-
This is a discussion related to Federation API returning null values for required metadata attributes. In components, these are entities with names models.<...>.Metadata as models.subject.Metadata.
Even syntactically these definitions are OK with OpenAPI specification, semantically it is questionable.
When these values are null it is unclear how we can search by these value using API endpoints search parameters.
We have multiple conversations about nullable+required metadata attributes including in Slack. This was one of the discussions with Clay's responses: https://uc-cri.slack.com/archives/C05GL22240Y/p1710528469367179
CCDI Hub Explore uses specific values as
If a value is not present in selected CDE's PVs, it is possible to request caDSR curators to add it.
Is it feasible avoiding null values for required harmonized attributes in API returned entities?
Beta Was this translation helpful? Give feedback.
All reactions