FIXTradingCommunity/fix-simple-binary-encoding

Can enum/set be optional?

OleksandrKvl opened this issue · 2 comments

Hi, in Euronext MDG schema there are bitset (<field id="5" name="strategyAuthorized" presence="optional" type="StrategyAuthorized_set"/>) and enum (<field id="3" name="eMM" presence="optional" type="EMM_enum"/>) fields marked as optional, is it legal? My understanding is that field with a non-built-in encoding always inherits and cannot change presence of its encoding (if only to constant). I can hardly imagine how this can be legal because 255 can be a valid enumerator and bitset can have all bits set which results in a value 255 for a set encoded by uint8. Can you confirm that it's not allowed?

First, let me say that only Euronext can explain the intention of their schema. We can only comment on what the standard allows. Their schema is based on SBE v1.0. I mention this because the v2.x release candidates removed some attributes from <type> elements and eliminated the inheritance model of <field> because it was deemed confusing.

Nevertheless, v1.0 specification states that "presence mismatch" is an error. If the attribute is specified on both a field and the encoding that it references, the values must be identical. In the case that you cite, I don't see an explicit mismatch.

The v1.0 spec does not explicitly say that presence="optional" is forbidden for bitsets, but it does say There is no explicit null value for multi-value choice encoding [bitset] other than to set all bits off when no choices are selected. So if it is marked optional, it is not an explicit violation, but it seems to be a moot point.

Thank you!