fix-simple-binary-encoding
fix-simple-binary-encoding copied to clipboard
Questions about common field attributes
- https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/master/v1-0-STANDARD/doc/02FieldEncoding.md#general-1 says that
nullValue
is mutually exclusive withpresence = required/constant
.presence=requires
is mutually exclusive withnullValue
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 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.
- Is it allowed to customize
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.
- There is just no reason to set a null value if a value is required or constant.
- Min and max are used to set a valid range. If the value is constant, the valid range is simply that value.
- NaN as the null value for floating point is covered by the spec here: https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/master/v1-0-STANDARD/doc/02FieldEncoding.md#null-values Min or max could be set for a valid range.
@donmendelson
- How so? Documentation says that
nullValue
is not a valid value for required field so in order to validate required field one should dominValue <= value && value <= maxValue && value != nullValue
, how could there be no reason to set it? Moreover, all built-in types havenullValue
, all other types inherit or redefine it so there's actually no type withoutnullValue
. If we suppose that required fields have nonullValue
and one receive255
foruint8
required field, how to check it, just by range? And what if the type hasmin=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 fornot-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?