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

items usage is asdf-1.1.0 history_entry fails to validate items beyond the first #436

Open
braingram opened this issue Jun 29, 2024 · 0 comments · May be fixed by #437
Open

items usage is asdf-1.1.0 history_entry fails to validate items beyond the first #436

braingram opened this issue Jun 29, 2024 · 0 comments · May be fixed by #437

Comments

@braingram
Copy link
Contributor

extensions:
type: array
items:
- $ref: "extension_metadata-1.0.0"
entries:
type: array
items:
- $ref: "history_entry-1.0.0"

Since the items value is a list (instead of an object) and there is no additionalItems the draft 4 defines this behavior:
https://json-schema.org/draft-04/draft-fge-json-schema-validation-00#rfc.section.8.2.3.2
as validating only the first item in the list against the schema (since there's only 1 schema in the list).

A similar issue exists with the "backwards compatible" part of the same schema:

# This is to support backwards compatibility with older history formats
- type: array
items:
- $ref: "history_entry-1.0.0"

Loading an ASDF file (hand edited) that includes:

history:
  extensions:
  - !core/extension_metadata-1.0.0
    extension_class: asdf.extension._manifest.ManifestExtension
    extension_uri: asdf://asdf-format.org/core/extensions/core-1.5.0
    manifest_software: !core/software-1.0.0 {name: asdf_standard, version: 1.0.4.dev187+g1458b25}
    software: !core/software-1.0.0 {name: asdf, version: 3.0.2.dev112+g143eb2d9}
  - some random stuff
  - 1

passes validation when the file is opened (but does fail when asdf attempts to check these history entries with a AttributeError: 'str' object has no attribute 'extension_uri').

@braingram braingram linked a pull request Jul 1, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant