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

Support for allowOtherValues attribute in Enum (Dictionary) #658

Open
ubermanl opened this issue Sep 21, 2020 · 0 comments
Open

Support for allowOtherValues attribute in Enum (Dictionary) #658

ubermanl opened this issue Sep 21, 2020 · 0 comments

Comments

@ubermanl
Copy link

When testing against a given data dictionary, from a market, found that the allowOtherValues attribute is ignored, hence when a tag has an enumerated value, unknown to the dictionary, the library issues a Reject.
In particular this is happening since the market does not provide a full list of the reject reasons, and when a reject is received, a reject of the reject is emited.

<field number="103" name="OrdRejReason" type="INT" allowOtherValues="true">
      <value enum="0" description="BROKER_EXCHANGE_OPTION" />
      <value enum="1" description="UNKNOWN_SYMBOL" />
      <value enum="2" description="EXCHANGE_CLOSED" />
      <value enum="3" description="ORDER_EXCEEDS_LIMIT" />
    ... more values ....
</field>

For what i can tell, i guess is here where this validation should be "skipped" if such attribute is present in the dictionary tag for the message:

public void CheckValue(Fields.IField field)
{
if (FieldsByTag.TryGetValue(field.Tag, out var fld))
{
if (fld.HasEnums())
{
if (fld.IsMultipleValueFieldWithEnums)
{
string[] splitted = field.ToString().Split(' ');
foreach (string value in splitted)
if (!fld.EnumDict.ContainsKey(value))
throw new IncorrectTagValue(field.Tag);
}
else if (!fld.EnumDict.ContainsKey(field.ToString()))
throw new IncorrectTagValue(field.Tag);
}
}
}

allowOtherValues is from Quickfix/j. Is there any plan to support it?

Thanks!.

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

No branches or pull requests

1 participant