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

Do not throw exception when flat_object field is explicitly null #15431

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

msfroh
Copy link
Collaborator

@msfroh msfroh commented Aug 26, 2024

Backport of #15375

Description

It is valid for a flat_object field to have an explicit value of null. (It's functionally the same as not specifying the field at all.) Prior to this fix, though, we would erroneously advance the context parser to the next token, violating the contract with DocumentParser (which says that a call to parseCreateField with a null value should complete with the parser still pointing at the null value -- it is DocumentParser's responsibility to advance).

Signed-off-by: Michael Froh froh@amazon.com

  • Fix unit test

Signed-off-by: Michael Froh froh@amazon.com

  • Add changelog entry

Signed-off-by: Michael Froh froh@amazon.com


Signed-off-by: Michael Froh froh@amazon.com
(cherry picked from commit 46a269e)

Related Issues

N/A

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

)

It is valid for a flat_object field to have an explicit value of
null. (It's functionally the same as not specifying the field at
all.) Prior to this fix, though, we would erroneously advance the
context parser to the next token, violating the contract with
DocumentParser (which says that a call to parseCreateField with
a null value should complete with the parser still pointing at
the null value -- it is DocumentParser's responsibility to advance).

Signed-off-by: Michael Froh <froh@amazon.com>

* Fix unit test

Signed-off-by: Michael Froh <froh@amazon.com>

* Add changelog entry

Signed-off-by: Michael Froh <froh@amazon.com>

---------

Signed-off-by: Michael Froh <froh@amazon.com>
(cherry picked from commit 46a269e)
Copy link
Contributor

❌ Gradle check result for 8416faa: null

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

✅ Gradle check result for 8416faa: SUCCESS

Copy link

codecov bot commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.68%. Comparing base (2f8c378) to head (8416faa).
Report is 8 commits behind head on 2.x.

Additional details and impacted files
@@             Coverage Diff              @@
##                2.x   #15431      +/-   ##
============================================
+ Coverage     71.60%   71.68%   +0.08%     
- Complexity    63465    63498      +33     
============================================
  Files          5208     5208              
  Lines        297313   297312       -1     
  Branches      43276    43276              
============================================
+ Hits         212896   213140     +244     
+ Misses        66587    66411     -176     
+ Partials      17830    17761      -69     

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

@reta reta merged commit e80c06e into 2.x Aug 27, 2024
63 checks passed
@msfroh msfroh deleted the backport/backport-15375-to-2.x branch August 28, 2024 05:46
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.

3 participants