taverntesting/tavern

question about nullable fields.

jaanauati opened this issue · 1 comments

Hi, how can I validate that a given field in the response is either null or string?

I was thinking on something like the following, which of course does not work:

...
json:
   fieldName: !anystr | null

Does tavern support combining types or nullable fields?

Tavern doesn't support this, and unless there's some support for parsing type hints to Python types (without using eval) I don't think this will ever be supported as it would be quite a bit of work