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

Omit expression and detail elements from OperationOutcome issues with no meaningful value #2999

Closed
lmsurpre opened this issue Nov 16, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request P3 Priority 3 - Nice To Have

Comments

@lmsurpre
Copy link
Member

lmsurpre commented Nov 16, 2021

Is your feature request related to a problem? Please describe.
While doing QA on #2050 I noted that our OperationOutcome.Issue has a expression like <empty>:
#2050 (comment)

This is coming from our FHIRUtil.buildOperationOutcomeIssue implementations.
If you call a different variant instead, you can end up with details like <no details> AND an expression like <no expression>.

I don't think these placeholder values have much value and, in fact, including elements which have no value sort of run contrary to the methodology/philosophy in FHIR. For example, from https://www.hl7.org/fhir/json.html#xml

Just as in XML, JSON objects and arrays are never empty, and properties never have null values (except for a special case documented below). Omit a property if it is empty

Describe the solution you'd like
Update all variants of FHIRUtil.buildOperationOutcomeIssue to omit the expression (and details) elements when we have no value for these.

We already do this for a lot of our OperationOutcome issues... I think its just the ones that call FHIRUtil.buildOperationOutcomeIssue which do this.

Describe alternatives you've considered

Acceptance Criteria

  1. GIVEN [a precondition]
    AND [another precondition]
    WHEN [test step]
    AND [test step]
    THEN [verification step]
    AND [verification step]

Additional context
Similar but different from #2596 which was closed as wontfix

QA suggestion
Test PUT with IfNoneMatch header set to * with existing version 1 of resource existing to verify the 412 error with an OperationOutcome->Issues->Expression does not contain '' value.

@prb112 prb112 added the enhancement New feature or request label Dec 6, 2021
@lmsurpre lmsurpre added the P3 Priority 3 - Nice To Have label Feb 14, 2022
@tbieste tbieste self-assigned this Feb 18, 2022
tbieste added a commit that referenced this issue Feb 18, 2022
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
lmsurpre added a commit that referenced this issue Feb 22, 2022
Issue #2999 - Omit OperationOutcome issue fields with no useful value
@lmsurpre
Copy link
Member Author

lmsurpre commented Mar 1, 2022

I ran the suggested test and confirmed that the OperationOutcome no longer contains <no expression>.

{
	"resourceType": "OperationOutcome",
	"id": "7f-0-0-1-8c5833d9-ac98-400e-8c8b-ce7cea5f130e",
	"issue": [
		{
			"severity": "fatal",
			"code": "conflict",
			"details": {
				"text": "IfNoneMatch precondition failed."
			}
		}
	]
}

I also forced a couple other error responses and never saw the <no expression> or <no details> text.

@lmsurpre lmsurpre closed this as completed Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P3 Priority 3 - Nice To Have
Projects
None yet
Development

No branches or pull requests

3 participants