Skip to content

Add AllowUnknownEnumValues setting to allow disabling enum validation - #1303

Merged
chrjohn merged 3 commits into
quickfix-j:masterfrom
konradbloor:feature/1290-allow-unknown-enum-values
Aug 14, 2026
Merged

Add AllowUnknownEnumValues setting to allow disabling enum validation#1303
chrjohn merged 3 commits into
quickfix-j:masterfrom
konradbloor:feature/1290-allow-unknown-enum-values

Conversation

@konradbloor

@konradbloor konradbloor commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Hi - I saw this issue and thought it would be interesting to try to submit a PR for it.

Resolves #1290

AllowUnknownEnumValues session setting added; this then skips validation of field values against the data dictionary enumerated values. This means they won't be rejected with IncorrectTagValue. The other validation checks are left unaffected. Fields without enumerated values behave as they did before. The per-field allowOtherValues dictionary attribute remains the targeted alternative for individual fields.

Mirrors the equivalent QuickFIX/N setting (connamara/quickfixn#929) in name, default (N), and semantics.

Unlike QuickFIX/N, the flag lives in ValidationSettings rather than in DataDictionary, since DataDictionary instances are cached/shared amongst sessions here.

Testing (tests written first and confirmed failing before the implementation):

  • Unknown enum value rejected by default; accepted with the setting enabled — including a multiple-value field (ExecInst) with one invalid token, mirroring the QuickFIX/N test
  • ValidationSettings copy constructor retains the new flag
  • DefaultSessionFactory wiring: setting Y propagates to the session; absent setting defaults to false
  • Full module suites pass: quickfixj-base (167 tests), quickfixj-core (1677 tests, incl. the acceptance suite)
  • Built/tested with the minimal-fix-latest,skipBundlePlugin profiles per AGENTS.md
  • Docs entry added to configuration.md

Adds a session-level setting that skips the validation of field values
against the data dictionary enumerated values.

The intention is that messages containing enum values that are not in
the dictionary don't get rejected with IncorrectTagValue. Values of
fields without enumerated values, and all other validation checks, are
unaffected.

Mirrors the equivalent QuickFIX/N setting (connamara/quickfixn#929) in
name, default (N), and semantics. The per-field `allowOtherValues`
dictionary attribute remains the targeted alternative.

The flag lives on ValidationSettings rather than DataDictionary because
DataDictionary instances are cached and shared across sessions.

Fixes quickfix-j#1290
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.42%. Comparing base (237d2bc) to head (6b63228).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1303      +/-   ##
============================================
+ Coverage     70.35%   70.42%   +0.07%     
- Complexity     2241     2247       +6     
============================================
  Files           159      159              
  Lines          9056     9065       +9     
  Branches       1192     1192              
============================================
+ Hits           6371     6384      +13     
+ Misses         2220     2217       -3     
+ Partials        465      464       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@the-thing the-thing left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok, but comments like these are not required. SCM or issue tracking is for history.

 /**
     * https://github.com/quickfix-j/quickfixj/issues/1290
     * */

@konradbloor

Copy link
Copy Markdown
Contributor Author

Thanks @the-thing for reviewing - good point! I removed them.

@konradbloor
konradbloor requested a review from the-thing August 13, 2026 08:54
}

private void checkValue(StringField field) throws IncorrectTagValue {
private void checkValue(ValidationSettings settings, StringField field) throws IncorrectTagValue {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this one. Injecting directly boolean flag instead of full object is probably better.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - I agree, is it worth my doing follow up PR so we have consistency amongst the neighbouring calls?

@the-thing the-thing Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate PR? - yes.

It might be worth keeping settings passed as an object if more than two flags (or two and more) are being read in a single method?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool - once I'm back later I'll do this separately. Agreed too many on one method won't help clarity, I'll have a look through and see what would be clearest 👍 Thanks again for the review.

@konradbloor
konradbloor requested a review from the-thing August 13, 2026 09:18

@the-thing the-thing left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@konradbloor

konradbloor commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review on this. Just confirming my plan - to make sure that plan works for anyone interested:

Once this has merged I'll then make a followup PR from master to make all the neighbouring calls inside DataDictionary consistent (so ValidationSettings aren't being passed when there's just, say, a single boolean that is relevant).

@chrjohn

chrjohn commented Aug 13, 2026

Copy link
Copy Markdown
Member

@konradbloor thanks for the PR.
@the-thing thanks for your review. I am OOO for the next weeks so will try to keep up as good as possible.

@chrjohn chrjohn modified the milestones: QFJ 3.0.2, QFJ 3.0.3 Aug 13, 2026
@chrjohn
chrjohn merged commit 2ac9d6d into quickfix-j:master Aug 14, 2026
14 checks passed
@konradbloor
konradbloor deleted the feature/1290-allow-unknown-enum-values branch August 14, 2026 07:06
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

Successfully merging this pull request may close these issues.

Add AllowUnknownEnumValues setting to add option to disable enumeration validation

3 participants