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

Support Case Insensitive Match on Property Names #674

Closed
1 task done
agrittob opened this issue Feb 28, 2024 · 2 comments
Closed
1 task done

Support Case Insensitive Match on Property Names #674

agrittob opened this issue Feb 28, 2024 · 2 comments
Labels
enhancement New feature in an existing library pkg:path

Comments

@agrittob
Copy link

Nuget Package

JsonPath.Net

Package Version

1.0.0

Can this library make doing something simpler?

Support finding property names via match so that a case insensitive regex may be used or support using JsonPath and match property names using case insensitive match. Alternative would be to provide a way to add custom/extendable ISelector implementations and inject them into the framework.

Describe alternatives you've considered.

I have considered taking the full json payload and doing a ToLower() on the whole but then the content/values are lower case.

Is there any other information you'd like to share regarding this enhancement?

I understand that this would have a larger performance impact because the JsonObject.TryGetPropertyValue does not support a case insensitive match and would instead require iteration over the property names of the object to find the match and then use that to get the value. This is why I would expect it to be an "opt-in" approach if you want to do a case insensitive and leave the default to doing the current functionality.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@agrittob agrittob added the enhancement New feature in an existing library label Feb 28, 2024
@gregsdennis
Copy link
Collaborator

Hello. I can possibly add this as an option, but it won't be enabled by default.

Also, this should be expressed as feature idea on the JSON Path spec repo.

Alternative would be to provide a way to add custom/extendable ISelector implementations and inject them into the framework.

The spec's only extension point right now is expression functions. I'm not open to offering a major feature like this as it's very much related to the spec framework itself, and I want to remain as close to spec as possible.

Again, the best way to effect change is by making proposals to the spec.

@gregsdennis
Copy link
Collaborator

Closing this for now in favor of your ietf-wg-jsonpath/draft-ietf-jsonpath-base#518.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature in an existing library pkg:path
Projects
None yet
Development

No branches or pull requests

2 participants