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

How does zjsonpatch test handle comparing numeric values? #151

Open
s-jepsen opened this issue Sep 23, 2022 · 0 comments
Open

How does zjsonpatch test handle comparing numeric values? #151

s-jepsen opened this issue Sep 23, 2022 · 0 comments

Comments

@s-jepsen
Copy link

s-jepsen commented Sep 23, 2022

According to RFC 6902:

4.6. test

The "test" operation tests that a value at the target location is
equal to a specified value.

The operation object MUST contain a "value" member that conveys the
value to be compared to the target location's value.

The target location MUST be equal to the "value" value for the
operation to be considered successful.

Here, "equal" means that the value at the target location and the
value conveyed by "value" are of the same JSON type, and that they
are considered equal by the following rules for that type:

o strings: are considered equal if they contain the same number of
Unicode characters and their code points are byte-by-byte equal.

o numbers: are considered equal if their values are numerically
equal.

o arrays: are considered equal if they contain the same number of
values, and if each value can be considered equal to the value at
the corresponding position in the other array, using this list of
type-specific rules.

How compliant is zjsonpatch according to this description?

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

No branches or pull requests

1 participant