Closed desaikd closed 2 weeks ago
This is fixed because ordered_elements
has been implemented in a simpler way by using a peekable iterator instead with #62.
Reopening because according to https://github.com/amzn/ion-schema/issues/62, ordered_elements
should be treated more like a regular expression/language. We will need something other than the peekable iterator to evaluate it. It will probably need a state machine, but it is possible that there is some other solution.
As part of the validation of
ordered_elements
constraint, it would require to implement a State Machine which can keep track ofoccurs
constraint and move to another state as per events(e.g.type:int
) .Example: For a constraint
ordered_elements: [int, decimal]
, State Machine constructs an NFA like below:Note::By default the
occurs
constraint would berequired
meaningrange::[1,1]
Given below is a summary tale representing the states and events for a value to be validated:
value: [1, 2.0]
value: [2.0, 1]
Prerequisite PR: #55 (
contains
implementation is required to be used withinoccurs
constraint whileordered_elements
constraint validation)