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

Mocha/Chai deep.equal fails when validating #19

Open
IoT-master opened this issue Nov 17, 2016 · 1 comment
Open

Mocha/Chai deep.equal fails when validating #19

IoT-master opened this issue Nov 17, 2016 · 1 comment

Comments

@IoT-master
Copy link

I am using your json schema to validate two endpoints/responses, and I am having trouble using a working validator. The only one that works well, and with complex JSON is the deep.equal in Mocha/Chai.

The issue occurs when the required field appears with an array and not consistently in the same order, which deep.equal flags as a fail. Could you possible sort the required array, or at least produce an array that's consistently in the same order? That would really help me out.

@IoT-master
Copy link
Author

"required": [
"high"
"low_moderate"
"low"
"moderate"
"moderate_high"
]

is compared to:

"required": [
"moderate_high"
"high"
"moderate"
"low_moderate"
"low"
]

as a fail (as an example)

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