FIXTradingCommunity / tablature

Easy authoring for rules of engagement using markdown
https://www.fixtrading.org/
Apache License 2.0
11 stars 8 forks source link

[md2orchestra] - "First group field not NumInGroup datatype" for TrdCapRptSideGrp #78

Open RODonnell80 opened 12 months ago

RODonnell80 commented 12 months ago

There are at least two groups in the Orchestra representation of FIX Latest whose first field has a type defined as a CodeSet. For example, TrdCapRptSideGrp defines tag 552 as its first field, but the field is defined as having a type of NoSidesCodeSet. Using md2orchestra, I receive 2 errors when including this group in the source markdown:

First group field not NumInGroup datatype; id= 552 in group=TrdCapRptSideGrp
Unknown group; id= 2061 scenario=base

The resulting group definition in the XML has:

<fixr:group id="2094" name="TrdCapRptAckSideGrp">
            <fixr:fieldRef id="552"/>

Looking at other groups, I believe this should be:

<fixr:group id="2094" name="TrdCapRptAckSideGrp">
            <fixr:numInGroup id="552"/>

Following some debugging, it appears that the 'type' of the first field in the group is validated, but the validation does not take this special case into account. I.e. if the returned type is a CodeSet then the validation fails, even though the type associated with the CodeSet may be 'numInGroup' - this is not checked.

I believe this special case should be handled and the expected result should be: