fixes serialization of regex pattern + description #1509
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes an issue introduced by #1498. We deflattened the structure due to issues with how the flattening algorithm caused the deserialization process to believe a pattern/description that was wrong to instead be missing. However, when we handrolled the
Deserialize
Implementation we also naively removed the flatten as well. This caused theSerialize
implementation (which was still macro derived) to deflatten. This caused the front end to interpret what it expected (but did not check CC @elvece) to be a regex but instead was an object that had a regex and string row. ThereforeU.test is not a function
is a result of indexing into the object to find what it thought to beRegex.test
but instead found nothing...because it was an object. Reintroducing theflatten
directive will undo this process without altering how theDeserialize
behaves.