FHIR Chat · update HAPI 4.0.0 · hapi

Stream: hapi

Topic: update HAPI 4.0.0


view this post on Zulip Dongtu (Aug 30 2019 at 07:57):

Hi everyone
I have updated the hapi version from 3.3.3 to 4.0.0. But now , Responding to a request in postman does not return OperationOutcome. In old version when successful it returns MethodOutcome with my BundleResource, whereas when it fails it returns OperationOutcome default
pasted image
pasted image

view this post on Zulip Dongtu (Aug 30 2019 at 07:59):

Now if I want return BundleResource I must use Prefer: return=representation. If I want return OperationOutcome I must use return=OperationOutcome . But I don't know my request success or fail. In the old version it was more flexible

view this post on Zulip Dongtu (Aug 30 2019 at 08:00):

@James Agnew

view this post on Zulip James Agnew (Aug 30 2019 at 09:25):

HAPI's behaviour was adjusted to match the recommendation in the FHIR spec:

In the absence of the header, servers may choose whether to return the full resource or not (but not the OperationOutcome; that should only be returned if explicitly requested)

You can still use the HTTP status code to determine whether a request was successful, or the presence of ERROR level issues in the OperationOutcome.

view this post on Zulip Dongtu (Aug 30 2019 at 09:34):

If I still want to return OperationOutcome, How can I do that in version 4.0.0

view this post on Zulip James Agnew (Aug 30 2019 at 09:35):

Using the prefer header:

Prefer: return=OperationOutcome

view this post on Zulip Dongtu (Aug 30 2019 at 09:38):

ok thanks so much. I understood the problem


Last updated: Apr 12 2022 at 19:14 UTC