-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle null values in fhir-server-config and throw for exceptional ca…
…se (#2822) * Handle null values in fhir-server-config and throw for exceptional case 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> * Update PropertyGroup.getProperties to omit properties with null values 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> * Update PropertyGroup.getJsonValue to normalize null and missing props 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> * Update fhir-config/src/main/java/com/ibm/fhir/config/PropertyGroup.java Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> Co-authored-by: Michael W Schroeder <66479070+michaelwschroeder@users.noreply.github.com> Co-authored-by: Michael W Schroeder <66479070+michaelwschroeder@users.noreply.github.com>
- Loading branch information
1 parent
ab593b1
commit 5b64365
Showing
6 changed files
with
151 additions
and
58 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.