Skip to content
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

Share Keyword Block #405

Open
PaulHuwe opened this issue Apr 16, 2024 · 2 comments
Open

Share Keyword Block #405

PaulHuwe opened this issue Apr 16, 2024 · 2 comments
Assignees

Comments

@PaulHuwe
Copy link
Collaborator

The keywords in base_exposure are presently duplicated in exposure and similarly for base_guidestar and guidestar. This is due to the sharing of base_exposure causing the ASDF schema_info function to fail. We need a new way to share keyword blocks between schemas.

@stscijgbot-rstdms
Copy link
Collaborator

This issue is tracked on JIRA as RAD-190.

@braingram
Copy link
Collaborator

braingram commented Dec 12, 2024

To provide an update on untangling this.

asdf.schema_info currently does not follow schema $refs. That seems like a bug. asdf-format/asdf#1875 addresses the issue but currently causes rad/roman_datamodels failures.

The failures are due to rad schemas using $ref in objects alongside other attributes. This violates the JSON reference specification: https://datatracker.ietf.org/doc/html/draft-pbryan-zyp-json-ref-03#section-3 and the above asdf change correctly ignores all non-$ref items in an object with a $ref (which causes critical information in the rad schemas to be correctly discarded). #525 updates the rad schemas putting $ref under an allOf combiner if the containing object has more keys than $ref.

Once #525 is merged the asdf PR can be merged, released and required versions updated. At that point we will have more flexibility in the rad schemas to use $ref (and can drop tagged scalars entirely).

One related item to consider is that schema_info is limited in what schema structures it can parse. The following schema usage presents an ambiguous archive_catalog keyword:

{
  "archive_catalog": "foo",
  "allOf": [   # pretend this is a $ref
    {
      "archive_catalog": "bar",
    }
  ]
}

Unit tests in rad could be added to verify that this ambiguity never exists for archive_catalog (and other special keywords) or an alternative to schema_info used that can accommodate this ambiguity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants