Skip to content

Validate nested attribute values using specs#53

Merged
astrofrog merged 1 commit into
mainfrom
fix-nested-attribute-verification
Mar 11, 2026
Merged

Validate nested attribute values using specs#53
astrofrog merged 1 commit into
mainfrom
fix-nested-attribute-verification

Conversation

@astrofrog
Copy link
Copy Markdown
Owner

AVMContainer now validates attribute values against the AVM specs when setting nested attributes (e.g., avm.Spatial.ReferencePixel). Previously, nested attributes bypassed all validation.

This also fixes several latent bugs in datatypes exposed by the new validation:

  • AVMFloat.check_data now correctly handles 0.0 (was treating it as None)
  • AVMString.check_data now accepts numeric values and converts them to strings
  • AVMOrderedFloatList.check_data now accepts tuples and native floats

Fixes #38

AVMContainer now validates attribute values against the AVM specs
when setting nested attributes (e.g., avm.Spatial.ReferencePixel).
Previously, nested attributes bypassed all validation.

This also fixes several latent bugs in datatypes exposed by the
new validation:
- AVMFloat.check_data now correctly handles 0.0 (was treating it as None)
- AVMString.check_data now accepts numeric values and converts them to strings
- AVMOrderedFloatList.check_data now accepts tuples and native floats

Fixes #38
@astrofrog astrofrog force-pushed the fix-nested-attribute-verification branch from d1c615e to 078eb3c Compare March 11, 2026 22:28
@astrofrog astrofrog merged commit 9369dfd into main Mar 11, 2026
24 checks passed
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 this pull request may close these issues.

Nested attribute values aren't verified

1 participant