Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about common field attributes #150

Open
OleksandrKvl opened this issue Jun 3, 2022 · 2 comments
Open

Questions about common field attributes #150

OleksandrKvl opened this issue Jun 3, 2022 · 2 comments
Labels

Comments

@OleksandrKvl
Copy link

  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.
@donmendelson
Copy link
Member

  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.

@OleksandrKvl
Copy link
Author

OleksandrKvl commented Jun 3, 2022

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants