-
Notifications
You must be signed in to change notification settings - Fork 339
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
HttpResponse result does not correctly indicate unexpected body type for Bundle #2772
Comments
Ha, this is not going to be very informative indeed: |
It will become "Operation GET......expected a body type of Bundle, but a ImagingStudy was returned". We don't really interpret the search string to figure out what kind of search results should be in the Bundle. And by the way, because of the |
When doing a Http request, if the bundle returns an unexpected body type, the error message is incorrect.
Please see lines 909 and 912 of
BaseFhirClient
.firely-net-sdk/src/Hl7.Fhir.Base/Rest/BaseFhirClient.cs
Line 909 in dc32002
To Reproduce
Steps to reproduce the behavior:
This could be reproduced in unit tests by returning a different resource type than requested.
IFhirSerializationEngine
and have it return a resource type ofImagingStudy
(for example)FhirOperationException : Operation GET on <URL HERE> expected a body of type Bundle but a Bundle was returned.
Expected behavior
The message in the exception should indicate the unexpected resource type:
The above code will throw:
FhirOperationException : Operation GET on <URL HERE> expected a body of type Practitioner but a ImagingStudy was returned.
Note: I am assuming the message here was to indicate the types of resources within the bundle entries...
Version used:
The text was updated successfully, but these errors were encountered: