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

Add JSONPath ignore feature to Comparator #4

Open
codemental opened this issue Jan 19, 2024 · 0 comments
Open

Add JSONPath ignore feature to Comparator #4

codemental opened this issue Jan 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@codemental
Copy link
Member

codemental commented Jan 19, 2024

The comparator must be extended to accept different validation options. The first option to be implemented is the ability to ignore different JSON fields based on specific JSONPaths. (more details about JSONPath here with the newest revision here; the second one is crazy long, they are here just for reference).

The JSONPaths that we will be supporting first will cover these cases:

  • $.store.book[0].title - target a specific field.
  • $..author | $.store..price - target a field with the specified name, wherever it is under a specific parent.
  • $.store.* - target all fields under a specific parent. $..* falls into this category, but I am curious of what use-cases this could cover.

The Builder already has a method to configure this (it's commented out).

@codemental codemental changed the title JsonPath ignore Add JsonPath ignore feature to Comparator Jan 19, 2024
@codemental codemental changed the title Add JsonPath ignore feature to Comparator Add JSONPath ignore feature to Comparator Jan 19, 2024
@codemental codemental added the enhancement New feature or request label Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant