Add AllowUnknownEnumValues setting to allow disabling enum validation - #1303
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
|
Thanks @the-thing for reviewing - good point! I removed them. |
| } | ||
|
|
||
| private void checkValue(StringField field) throws IncorrectTagValue { | ||
| private void checkValue(ValidationSettings settings, StringField field) throws IncorrectTagValue { |
There was a problem hiding this comment.
I missed this one. Injecting directly boolean flag instead of full object is probably better.
There was a problem hiding this comment.
Thanks - I agree, is it worth my doing follow up PR so we have consistency amongst the neighbouring calls?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
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). |
|
@konradbloor thanks for the PR. |
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
allowOtherValuesdictionary 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):
ExecInst) with one invalid token, mirroring the QuickFIX/N testValidationSettingscopy constructor retains the new flagDefaultSessionFactorywiring: settingYpropagates to the session; absent setting defaults to falsequickfixj-base(167 tests),quickfixj-core(1677 tests, incl. the acceptance suite)minimal-fix-latest,skipBundlePluginprofiles per AGENTS.mdconfiguration.md