Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Validation Rules do not work for some special values (false, 0, null, ...) #130

Closed
Beutlin opened this issue Jan 23, 2019 · 1 comment
Closed

Comments

@Beutlin
Copy link

Beutlin commented Jan 23, 2019

Describe the bug
After the request the validation of json data is in some cases wrong.

To Reproduce

  1. Call some page which returns this simple JSON:
    { a: false, b: 0, c: null }

  2. Validate a, b, c in your config with:
    {jsonpath: content.a, expect: false, jsonpath: content.b, expect: 0, jsonpath: content.c, expect: null }

  3. Result:
    Schema Validation failed: ""expect" must be a boolean"

Expected behavior
No errors, as the returned value and the expected value are the same.

Additional context
Have a look at https://dorey.github.io/JavaScript-Equality-Table/.
Here are some corner cases which value of variables might be compared to the corresponded value.

@Beutlin
Copy link
Author

Beutlin commented Jan 23, 2019

Oh, I've just seen that this issue is already fixed on the master branch.
Maybe you can update the version of your software, thus that users who install strest with npm also benefit from it.

@Beutlin Beutlin closed this as completed Jan 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant