FIXTradingCommunity / fix-simple-binary-encoding

A FIX standard for binary message encoding
Other
262 stars 69 forks source link

xsd field/@epoch not described in docs / data fields not validated #75

Closed bkc closed 6 years ago

bkc commented 6 years ago

Is the element 'epoch' defined at https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/c687555595aecd6672bba7d319f167a8c07a97a0/v1-0-STANDARD/resources/sbe.xsd#L287 deprecated similar to the elementTimeUnit?

'epoch' is not mentioned in https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/v1.0/v1-0-STANDARD/doc/04MessageSchema.md

Also message/data elements are not described in the MessageSchema.md file. Because these are expected to be variable length data types, should there be some kind of validation rules for data elements listed in section https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/v1.0/v1-0-STANDARD/doc/04MessageSchema.md#schema-validation

e.g. is this an error? <data name="bad" id="523" type="uint8" />

bkc commented 6 years ago

related,this comment seems out of place https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/c687555595aecd6672bba7d319f167a8c07a97a0/v1-0-STANDARD/resources/sbe.xsd#L298

donmendelson commented 6 years ago

The epoch metadata attribute was proposed in an early draft of SBE, but no value other than unix was ever offered. Therefore, it was deprecated in version 1.0 RC3, before we moved the spec project to GitHub. It was kept for backward compatibility in version 1.0 but was removed in version 2.0.

Similarly, timeUnit attribute was originally conceived as out-of-band metadata. It was changed to be sent on the wire, if desired, for timestamps of mixed precision. If all timestamps are of the same precision, timeUnit can be specified as constant in a message schema.

The XML comment about deprecation should have applied to both epoch and timeUnit.

donmendelson commented 6 years ago

The intention of <data> XML element was to only support variable-length data, and the examples given are only of that type. However, the spec does not explicitly say that <data> with a fixed-length type is an error. I propose that this be added to the list of errors in the "Schema validation" section for version 2.0.