aind-data-schema icon indicating copy to clipboard operation
aind-data-schema copied to clipboard

Schema version field prevents validating older versioned data

Open dbirman opened this issue 4 months ago • 2 comments

User story

As a user I want to to be able to validate models when the underlying data is valid. I can't do this because old data (which might be valid under the current schema) will always fail to validate because of the schema_version field.

Would be great to get a solution built into the schema for this, possibly annotating the version field with https://docs.pydantic.dev/2.0/api/functional_validators/#pydantic.functional_validators.SkipValidation

Acceptance criteria

  • [ ] An old metadata.json with version 1.0.0 (for example) should validate against aind-data-schema 1.1.0, etc.

Sprint Ready Checklist

  • [ ] 1. Acceptance criteria defined
  • [ ] 2. Team understands acceptance criteria
  • [ ] 3. Team has defined solution / steps to satisfy acceptance criteria
  • [ ] 4. Acceptance criteria is verifiable / testable
  • [ ] 5. External / 3rd Party dependencies identified
  • [ ] 6. Ticket is prioritized and sized

Notes

Removing the field doesn't work because it's required

dbirman avatar Oct 07 '24 04:10 dbirman