Closed desaikd closed 2 years ago
Should there be a Violation returned when an OwnedElement with annotation is passed to validate with valid_values constraint or silently ignore the annotation? (Note: current implementation ignores the annotation)
No. The current implementation is correct. This constraint is intended to compare the value, excluding annotations. In fact, it is even illegal to use annotations on the valid values arguments, with the exception of ranges (e.g. valid_values: [foo::1]
is illegal).
Good question, though. 👍🏼
Issue #9 #10
Description of changes: This PR works on adding implementation of
valid_values
constraint.Grammar:
Ion Schema specification: https://amzn.github.io/ion-schema/docs/spec.html#valid_values
List of changes:
Number
range implementation (https://github.com/amzn/ion-schema-rust/pull/92/commits/d184e29462a756524e68c98d1a46767a7a1ace63) (Note:Timestamp
ranges are not completely implemented yet, refer #91)ValidValues
enum variants forIslConstraint
andConstraint
ValidValuesConstraint
implementationsvalid_values
Tests: added unit tests for
valid_values
implementation.valid_values
constraintvalid_values
constraintvalid_values
constraintQuestion: Should there be a
Violation
returned when anOwnedElement
with annotation is passed to validate withvalid_values
constraint or silently ignore the annotation? (Note: current implementation ignores the annotation)