Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Error - HAPI STU3 / R3 - returned HTTP status was 200(Ok) - should be 201(Created) #1299
Describe the bug
Test Script: /FHIR3-0-1-Basic/A-C/AllergyIntolerance/Client Assigned Id/AllergyIntolerance-client-id-xml
Test System: http://fhirtest.uhn.ca/baseDstu3
Error message below
Operation | updateCreate AllergyIntolerance
just had a look at the testscript. This is a test using UPDATE to create a resource with a given ID.
The testscript reuses the ID in every test and deletes the generated resource after the creation. During the next test run this deleted resource is updated to be not deleted anymore. This is considered as an update by hapi so the returned status code = 200.
Ohhhhh.... In that case I kinda think this is a HAPI FHIR bug after all. This is a pretty niche edge case but I think it's fair to say that updating a previously deleted resource counts as a create and should return a 201. This is mostly personal opinion of course, but I think it makes sense..…
On Mon, May 6, 2019 at 2:56 PM Patrick Werner ***@***.***> wrote: @jamesagnew <https://github.com/jamesagnew> the resource is already deleted before the test starts, but as it isn't expunged. So hapi already knows this id. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#1299 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AA2N7HO5ZVMOSAHYNMYVVIDPUB5OHANCNFSM4HK4DRRQ> .
Hello Patrick, We enjoy the conversation(s) - thanks for the feedback … James - yes, we do delete prior to the next run (I think that is what Patrick is reporting) while the resource is present it is in a deleted status. So, if you create/update against an existing resource (which is in a sense an Update and not a Create) - does the status of the resource i.e. "Deleted" change the operation outcome to an Update (200-ok) or should it be a Create (201-Created, due to it being in a delete status) - I like Innnnnteresting :) I see the order of the test script executions makes it appear that XML is only affected. I see why it happens with the XML Client-Assigned ID test script execution, and not when I run the JSON test script - I receive the 201(Created) as expected. I have added Richard Ettema (AEGIS - FHIR guy) to the conversation for situational awareness, and comment. Thanks, Mario…
________________________________ From: James Agnew [firstname.lastname@example.org] Sent: Monday, May 06, 2019 2:38 PM To: jamesagnew/hapi-fhir Cc: Mario G. Hyland (AEGIS.net); Mention Subject: Re: [jamesagnew/hapi-fhir] Error - HAPI STU3 / R3 - returned HTTP status was 200(Ok) - should be 201(Created) (#1299) Innnnnteresting. @patrick-werner<https://github.com/patrick-werner> I agree with your assessment. @Interopguy<https://github.com/Interopguy> Are you guys able to modify the test to delete the resource first if it already exists? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub<#1299 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ADJOSMUEYQNC73FTDF65L3LPUB3KTANCNFSM4HK4DRRQ>.