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
nullValue is mutually exclusive with presence = required/constant. presence=requires is mutually exclusive with nullValue
My understanding of that phrase is that having a nullValue attribute automatically makes field optional. This can hardly be correct because nullValue is not a valid value for a required field so it actually needs this attribute to check its value, in other words, nullValue is NOT mutually exclusive with required/optional. Is it correct and documentation is wrong here?
The same page says that presence=constant is mutually exclusive with min/max/nullValue. Does it mean that no constraints are applied to constant values? For example is it legal to have constant 255 for uint8 type? Because for required types nullValue is not a valid value.
Is it allowed to customize min/max/nullValue for floating point types? I suspect that yes, just want to be sure. The real question: is NaN literal supported? I mean, can I write <type name="MyDouble" primitiveType="double" maxValue="100" nullValue="NaN"/>? No hint about it in the documentation.
The text was updated successfully, but these errors were encountered:
How so? Documentation says that nullValue is not a valid value for required field so in order to validate required field one should do minValue <= value && value <= maxValue && value != nullValue, how could there be no reason to set it? Moreover, all built-in types have nullValue, all other types inherit or redefine it so there's actually no type without nullValue. If we suppose that required fields have no nullValue and one receive 255 for uint8 required field, how to check it, just by range? And what if the type has min=0, max=10, null=9? Or such a configuration is not allowed by saying that null value is not a valid value?
OK, clear enough, thanks.
From that part it's not clear if NaN is just a shortening for not-a-number for the description purpose or it is a legal literal which can be used in the XML schema. So you confirm that it can be used in XML?
My understanding of that phrase is that having a
nullValue
attribute automatically makes fieldoptional
. This can hardly be correct becausenullValue
is not a valid value for a required field so it actually needs this attribute to check its value, in other words,nullValue
is NOT mutually exclusive withrequired/optional
. Is it correct and documentation is wrong here?presence=constant
is mutually exclusive withmin/max/nullValue
. Does it mean that no constraints are applied to constant values? For example is it legal to have constant255
foruint8
type? Because forrequired
typesnullValue
is not a valid value.min/max/nullValue
for floating point types? I suspect that yes, just want to be sure. The real question: isNaN
literal supported? I mean, can I write<type name="MyDouble" primitiveType="double" maxValue="100" nullValue="NaN"/>
? No hint about it in the documentation.The text was updated successfully, but these errors were encountered: