fix-simple-binary-encoding icon indicating copy to clipboard operation
fix-simple-binary-encoding copied to clipboard

Questions about common field attributes

Open OleksandrKvl opened this issue 2 years ago • 2 comments

  1. https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/master/v1-0-STANDARD/doc/02FieldEncoding.md#general-1 says that

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?


  1. 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.

  1. 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.

OleksandrKvl avatar Jun 03 '22 19:06 OleksandrKvl

  1. There is just no reason to set a null value if a value is required or constant.
  2. Min and max are used to set a valid range. If the value is constant, the valid range is simply that value.
  3. 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 avatar Jun 03 '22 19:06 donmendelson

@donmendelson

  1. 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?
  2. OK, clear enough, thanks.
  3. 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?

OleksandrKvl avatar Jun 03 '22 20:06 OleksandrKvl