Open sed-i opened 1 month ago
Thanks for filing this and for providing a minimal reproducible example, I am able to reproduce the issue.
panic == immediate bug =)
I've marked this as approved and will take a look tomorrow. Many thanks for catching this. Interestingly, it seems to only happen with the and
, for example.. this does not panic:
matching:
example:
content: '{"this": {"is": {"just": {"a": "test"}}}}'
matches:
gjson:
this.is.typo:
- {have-key: "a"}
output:
$ goss v
F
Failures/Skipped:
Matching: example: matches:
Error
matchers.Gjson{Path:"this.is.typo"}: Path not found: this.is.typo
the transform chain was
[{"gjson":{"Path":"this.is.typo"}}]
the raw value was
"{\"this\": {\"is\": {\"just\": {\"a\": \"test\"}}}}"
Total Duration: 0.000s
Count: 1, Failed: 1, Skipped: 0
Describe the bug Using gjson matching, if the key does not exist in content, goss panics.
How To Reproduce
Expected Behavior To get a regular goss
F
failure with details on the mismatched key.Actual Behavior
Environment: