json-schema-generator
json-schema-generator copied to clipboard
Mocha/Chai deep.equal fails when validating
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.
"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)