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: matching required paths with slashes #2367

Merged
merged 3 commits into from
Aug 16, 2024

Conversation

adamskeeled
Copy link
Contributor

In JSON Pointers two characters need to be escaped: '~' is converted to '~0' and '/' is converted to '~1'.
When JSON Paths contain one of these two characters, when trying to check whether those path are required, the isRequired function is used. That function compares the scoped path (which in this case is the encoded path with the converted symbols) with the closest required array (which contains the original unencoded path with either ~ or /).

Before checking the required array, we need to decode the scoped path so the comparison works properly.

Fixes #2366

@CLAassistant
Copy link

CLAassistant commented Aug 14, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

netlify bot commented Aug 14, 2024

Deploy Preview for jsonforms-examples ready!

Name Link
🔨 Latest commit 463d9ff
🔍 Latest deploy log https://app.netlify.com/sites/jsonforms-examples/deploys/66bf3aca017fe900084b7c26
😎 Deploy Preview https://deploy-preview-2367--jsonforms-examples.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

packages/core/src/mappers/renderer.ts Outdated Show resolved Hide resolved
packages/core/src/mappers/renderer.ts Outdated Show resolved Hide resolved
@sdirix
Copy link
Member

sdirix commented Aug 14, 2024

Thanks for the contribution and the included test case ❤️ That's what we like to see ;)

@adamskeeled adamskeeled requested a review from sdirix August 14, 2024 14:55
Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@coveralls
Copy link

Coverage Status

coverage: 83.265%. remained the same
when pulling 463d9ff on adamskeeled:fix/slash-required-matching
into 26fd0e9 on eclipsesource:master.

@sdirix sdirix merged commit 64b569c into eclipsesource:master Aug 16, 2024
8 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.

isRequired encoded scope paths with slashes not properly matched
4 participants