[bug]: a changed array element is graded as only new fields added, which can auto-pass a failing test
Author: omlahoreCreated Sep 19, 2026Updated Sep 21, 2026
Labelskeploy
Is there an existing issue for this?
- I have searched and didn't find similar issue
Current behavior
I was reading the additive auto-pass after #4601 and I think the grading under it is off for arrays. collectJSON gives every element of an array the same path key, so later elements overwrite earlier ones and a changed element leaves ValueChanges empty. When the response also gained a field, ComputeFailureAssessmentJSON grades that as Low with SCHEMA_ADDED, and autoPassHTTPResponseSchemaAddition turns a failing test into a pass. The same collapse grades {"items":["a","b","c"]} against {"items":["c"]} as "Schema and values are identical".
Steps to Replicate
- Call ComputeFailureAssessmentJSON with {"items":["a","b"],"x":1} and {"items":["z","b"],"x":1,"newField":2}.
- ValueChanges comes back empty, Risk is LOW and the reason is "Backward-compatible: only new fields added.".
- Run the same pair through httpMatcher.Match and autoPassHTTPResponseSchemaAddition and the failing testcase passes.
Operating system
MacOS
Version
main at bac49ba
Repository
keploy
Source: keploy/keploy