Conversation
Previously, we'd through an IllegalStateException if we encountered a null value. This came up because the helm `toJson` function produces all possibly fields for an object, even when some are null. If we have an invalid config (such as described above), in FHIRRestHelper.validateResource we were swallowing the underlying exception and instread constructing a generic OperationOutcomeIssue with message "Error retrieving profile configuration". This was being handled just like any other validation error and so, even though it was a server config issue, this was not clear to the client. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
punktilious
reviewed
Oct 4, 2021
prb112
approved these changes
Oct 4, 2021
Now that convertJsonValue can return null, this is safer/easier than updating all the callers to be able to handle null. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
Previously this method returned null for missing properties, but JsonValue.NULL for properties that exist in the config with a literal value of null. We had null checks in all the getTypedProperty methods that call this one, but none of them handled `JsonValue.NULL` and so I've updated this one spot. I also added unit test coverage for both PropertyGroup and FHIRConfigHelper Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
michaelwschroeder
approved these changes
Oct 4, 2021
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> Co-authored-by: Michael W Schroeder <66479070+michaelwschroeder@users.noreply.github.com>
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.
Previously, we'd throw an IllegalStateException if we encountered a
null value. This came up because the helm
toJsonfunction produces allpossible fields for an object, even when some are null.
Additionally, if we have an invalid config (such as described above), in
FHIRRestHelper.validateResource we were swallowing the underlying
exception and instread constructing a generic OperationOutcomeIssue with
message "Error retrieving profile configuration". This meant we were missing
the root cause in our logs and also meant that this exception was being handled
just like any other validation error and so, even though it was a server
config issue, this was not clear to the client.
Signed-off-by: Lee Surprenant lmsurpre@us.ibm.com