Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix escaping in JSON schema patterns #487

Merged
merged 2 commits into from
May 8, 2024

Conversation

mristin
Copy link
Contributor

@mristin mristin commented May 8, 2024

The escaping logic for patterns in JSON schema got convoluted, and we introduced inadvertently inconcistencies in the formatting. Namely, we first unescaped all the characters before passing them into the parser for regular expressions. This unescaped characters later propagated and mixed with escaped characters when the expression was transpiled for UTF-16.

To solve this mess, we remove the unescaping step at the beginning and test more thouroughly to specify & observe the expected behavior.

Fixes #485.

The escaping logic for patterns in JSON schema got convoluted, and we
introduced inadvertently inconcistencies in the formatting. Namely, we
first *unescaped* all the characters before passing them into the parser
for regular expressions. This unescaped characters later propagated and
mixed with *escaped* characters when the expression was transpiled for
UTF-16.

To solve this mess, we remove the unescaping step at the beginning and
test more thouroughly to specify & observe the expected behavior.
@mristin mristin force-pushed the mristin/Fix-escaping-in-JSON-schema-patterns branch from 01cde4d to d665440 Compare May 8, 2024 08:50
@mristin mristin merged commit 4a8a01e into main May 8, 2024
8 checks passed
@mristin mristin deleted the mristin/Fix-escaping-in-JSON-schema-patterns branch May 8, 2024 10:18
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.

Escapes are missing in JSON Schema patterns
1 participant