From 92a070430a2d45edff787499b4c6a1d1c1b052eb Mon Sep 17 00:00:00 2001 From: Robbert van Waveren Date: Thu, 13 Oct 2016 12:03:48 +0200 Subject: [PATCH 1/3] fix resources links being correctly indexed when linking eachother as part of a single transaction bundle --- .../src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java index 3ce1acb1c1a..e1ae359e956 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java @@ -1415,6 +1415,8 @@ public abstract class BaseHapiFhirDao implements IDao { for (ResourceLink next : links) { myEntityManager.persist(next); } + // make sure links are indexed + theEntity.setResourceLinks(links); } // if thePerformIndexing From b59c24ab7c06cdc3eed462a8c60be29d7d21c717 Mon Sep 17 00:00:00 2001 From: "michael.i.calderero" Date: Tue, 17 Jan 2017 20:37:43 -0600 Subject: [PATCH 2/3] return 404 instead of 400 when the FHIR resource/endpoint is not recognized/not supported --- .../src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java | 3 ++- .../java/ca/uhn/fhir/rest/server/RestfulServerMethodTest.java | 4 ++-- .../java/ca/uhn/fhir/rest/server/ServerFeaturesDstu2Test.java | 2 +- .../interceptor/ResponseHighlightingInterceptorTest.java | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java index 215d9c9293e..d673656cd24 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java @@ -75,6 +75,7 @@ import ca.uhn.fhir.rest.server.exceptions.AuthenticationException; import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.exceptions.NotModifiedException; +import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.rest.server.interceptor.ExceptionHandlingInterceptor; import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor; import ca.uhn.fhir.rest.server.interceptor.ResponseHighlighterInterceptor; @@ -253,7 +254,7 @@ public class RestfulServer extends HttpServlet implements IRestfulServerOperationOutcome", "Unknown resource type 'Foobar' - Server knows how to handle"))); assertThat(responseContent, (stringContainsInOrder("Unknown resource type 'Foobar'"))); From dc17157db85a1146ddb79718ab8e63aace105c84 Mon Sep 17 00:00:00 2001 From: James Agnew Date: Fri, 20 Jan 2017 18:49:01 -0500 Subject: [PATCH 3/3] Credit for #539 --- src/changes/changes.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 213489b85f5..1aed599ba27 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -217,6 +217,11 @@ JPA server terminology service was not correctly validating or expanding codes in SNOMED CT or LOINC code systems. Thanks to David Hay for reporting! + + Attempting to search for an invalid resource type (e.g. GET base/FooResource) should + return an HTTP 404 and not a 400, per the HTTP spec. Thanks to + GitHub user @CarthageKing for the pull request! +