Open humbienri opened 4 years ago
Hi @humbienri, you are correct that this more complex sort of matching is not cleanly supported by curl-runnings right now. You could check that details
or info
are the exact thing you're expecting, but not much more than that if you have such a similar payload in both spots.
This is something I have been meaning to add, but haven't had the need yet and you're the first to ask for it. 😄 I'll think on ways to implement this, I think there are some relatively lightweight solutions like allowing you to supply a traversal path to run the matcher at.
To make sure I am accounting for what you have in mind, can you give me an example or two of something you're trying to assert about this payload you shared?
Hello,
I was envisioning doing something like jsonschema validation to a response payload. For example, https://davidwalsh.name/json-validation
be able to specify keys and structure pretty tightly yet not specify hard coded or fixed values but types of values, like strings or numbers, etc.
I really the idea of type checking against a json schema. Probably won't be too hard to add. Making a separate issue for that to track it.
Hello,
Perhaps I am just not getting it, even after having read the
example-spec.yaml
example. How can I validate a more complicated response body/payload. For example, something like:I guess I am referring to nesting of json objects so as to confirm that the response body conforms to something more specific. Notice how some of those
status
keys are duplicated so it's not just a matter of validating that the "status up" exists somewhere in the response, but specifically.Thanks!