Gracefully handle unknown fields#316
Merged
Rafal Niski (rafalniski) merged 4 commits intocontentful:masterfrom Jun 20, 2025
Merged
Gracefully handle unknown fields#316Rafal Niski (rafalniski) merged 4 commits intocontentful:masterfrom
Rafal Niski (rafalniski) merged 4 commits intocontentful:masterfrom
Conversation
|
Just noting, thanks for working on this! Will definitely help reduce errors in our application. |
|
This would be an impactful improvement if it could get reviewed and merged. |
|
With this update our organization would experience a reduction in errors. Hopefully this gets merged in. |
Rafal Niski (rafalniski)
approved these changes
Jun 18, 2025
Lisa White (whitelisab)
approved these changes
Jun 18, 2025
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.
We have had the following issues arise a few times now:
As the code appears to be to parse the CDAEntry and assume that a corresponding field exists on the Result (DTO representation in our code) using reflection to directly call the setter, it opens up the opportunity for this to potentially happen for content fields that are not defined in the DTO model representation.
This suggestion is to ignore those exceptions and continue on with what we do know how to handle. I don't believe we should have to denote EVERY single field explicitly on our side to have the CDAClient transform correctly.
If this is not desired, perhaps this can be gated behind a property on the CDAClient to let users decide? I'm also open to proper logging behavior for this as I do not see much logging within this client for situations like this.