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

Allow unknown value data types [4.5] #699

Merged

Conversation

phil-davis
Copy link
Contributor

Backport PR #674 to 4.5 branch

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.
Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.58%. Comparing base (82e8f3e) to head (4761ca2).
Report is 5 commits behind head on 4.5.

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.
📢 Have feedback on the report? Share it here.

@phil-davis phil-davis merged commit 3c6bd88 into sabre-io:4.5 Oct 22, 2024
10 of 11 checks passed
@phil-davis phil-davis deleted the allow-unknown-value-data-types-4.5 branch October 22, 2024 06:33
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.

2 participants