Skip to content

fix: matching required paths with slashes - #2367

Merged
sdirix merged 3 commits into
eclipsesource:masterfrom
adamskeeled:fix/slash-required-matching
Aug 16, 2024
Merged

fix: matching required paths with slashes#2367
sdirix merged 3 commits into
eclipsesource:masterfrom
adamskeeled:fix/slash-required-matching

Conversation

@adamskeeled

Copy link
Copy Markdown
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

CLAassistant commented Aug 14, 2024

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@netlify

netlify Bot commented Aug 14, 2024

Copy link
Copy Markdown

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.

Comment thread packages/core/src/mappers/renderer.ts Outdated
Comment thread packages/core/src/mappers/renderer.ts Outdated
@sdirix

sdirix commented Aug 14, 2024

Copy link
Copy Markdown
Member

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

@sdirix sdirix left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown

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
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