Repository navigation
Allow unknown value data types [4.5] - #699
Merged
phil-davis merged 3 commits intoOct 22, 2024
Merged
Conversation
Currently value-types that are not known will cause the parser to throw an InvalidDataException. In RFC5545, Section 3.2.20 is described though that the allowed values for the "VALUE" data-type can include x-names and iana-tokens. These can be any string that might - or might not - be understood by the parser. The description clearly states that "Applications MUST preserve the value data for x-name and iana-token value that they don't recognize without attempting to interpret or parse the value data" This means that the content of the "VALUE" part should not be interpreted at all the moment the parser doesn't find a match in the corresponding mapping table. But it should also not hard-fail when someone sets a VALUE that might not be understood. In such a case the default should be used instead.
THis adds a test to assure that an unknown value is skipped. The value `DATETIME` is not known. It should be `DATE-TIME`. Adding the value of DATETIME previopusly resulted in an Error. This now tests that it actually works and that the unknown parameter is actually also kept as specified by the RFC
This will remove the necesity to calculate the class name twice in immediate succession should the declared valuetype not be set.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 4.5 #699 +/- ##
============================================
- Coverage 98.65% 98.58% -0.08%
+ Complexity 1932 1931 -1
============================================
Files 71 71
Lines 5297 5507 +210
============================================
+ Hits 5226 5429 +203
- Misses 71 78 +7 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport PR #674 to 4.5 branch