You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In principle, implementations ought to handle any representable data. In practice... practicality sometimes beats purity. I therefore propose that we should add two new arguments to from_schema(), and plumb them through.
allow_x00: bool = True
Requests containing the zero codepoint, "\x00", are rejected as invalid by many servers (see e.g. schemathesis/schemathesis#1286, schemathesis/schemathesis#1562, schemathesis/schemathesis#1668). Arguably they should, but in the meantime it seems useful to offer Schemathesis a mechanism to exclude the zero codepoint and schema-level granularity seems sufficient.
This is a fairly simple matter of passing through the argument, and then adding min_codepoint=1 if it's False. I'm unsure what we should name it; leading candidates are allow_x00 to emphasize the low-level nature or allow_codepoint_zero to spell it out.
codec: str | None ="utf-8"
Per schemathesis/schemathesis#1142 (comment) and schemathesis/schemathesis#1286, users often want to restrict inputs to the ASCII range. This is fundamentally kinda wrong, but we live in a broken world and sometimes harm reduction (i.e. allowing people to use advanced testing tools anyway) is the best option left to us.
In principle, implementations ought to handle any representable data. In practice... practicality sometimes beats purity. I therefore propose that we should add two new arguments to
from_schema()
, and plumb them through.allow_x00: bool = True
Requests containing the zero codepoint,
"\x00"
, are rejected as invalid by many servers (see e.g. schemathesis/schemathesis#1286, schemathesis/schemathesis#1562, schemathesis/schemathesis#1668). Arguably they should, but in the meantime it seems useful to offer Schemathesis a mechanism to exclude the zero codepoint and schema-level granularity seems sufficient.This is a fairly simple matter of passing through the argument, and then adding
min_codepoint=1
if it'sFalse
. I'm unsure what we should name it; leading candidates areallow_x00
to emphasize the low-level nature orallow_codepoint_zero
to spell it out.codec: str | None ="utf-8"
Per schemathesis/schemathesis#1142 (comment) and schemathesis/schemathesis#1286, users often want to restrict inputs to the ASCII range. This is fundamentally kinda wrong, but we live in a broken world and sometimes harm reduction (i.e. allowing people to use advanced testing tools anyway) is the best option left to us.
Implementation here is easy in
hypothesis-jsonschema
, but requires upstream issues as a prerequisite: HypothesisWorks/hypothesis#1664 and HypothesisWorks/hypothesis#3479.The text was updated successfully, but these errors were encountered: