Closed oweidner closed 9 years ago
No, this is expected. The readme says,
Note: Marking a field as "required" means that you do not allow the zero value for that type (i.e. if you want to allow 0 in an int field, do not make it required).
There is no way to infer from the zero value whether it was missing or not. This is because binding is a process independent of deserialization.
Ah, never mind then. Thanks for clarifying!
In the above example, bind gives me a
RequiredError
when I POST the following JSON string:However, when I set
online
to 'true' in the above JSON string, binding works fine. I assume this is a bug as afalse
value should still fulfill therequired
tag?