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

Remove tag property from root object of core schemas #269

Closed
eslavich opened this issue Jun 29, 2020 · 1 comment
Closed

Remove tag property from root object of core schemas #269

eslavich opened this issue Jun 29, 2020 · 1 comment

Comments

@eslavich
Copy link
Contributor

Our current use of tag prevents users from extending the core schemas. For example, say someone wants to extend our software-1.0.0 schema to include an additional optional release_date property. It would be natural to implement like this:

id: http://example.com/schemas/extended_software-1.0.0

allOf:
  - $ref: http://stsci.edu/schemas/asdf/core/software-1.0.0
  - properties:
      release_date:
        type: string

But this doesn't work, because the tag property enforces that the object's tag be software-1.0.0, and the object that we validate with this schema will instead have tag extended_software-1.0.0.

Does tag serve a useful purpose in the root object of a schema? Schemas are matched to objects by tag in the first place, so it seems redundant to check the tag again during validation.

For the record, I had previously suggested removing tag from the metaschema altogether because I didn't understand its purpose as a validation directive. Now I'm suggesting that we remove it from the root object of the core schemas, but keep it in the metaschema for use cases like #268.

@braingram
Copy link
Contributor

Fixed by: #421

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

No branches or pull requests

2 participants