diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/2904-swagger-ui-Does-not-work-with-partitions.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/2904-swagger-ui-Does-not-work-with-partitions.yaml new file mode 100644 index 00000000000..241a5c78253 --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/2904-swagger-ui-Does-not-work-with-partitions.yaml @@ -0,0 +1,4 @@ +--- +type: change +issue: 2904 +title: "Change getPathItem method in OpenApiInterceptor from private to protected" diff --git a/hapi-fhir-server-openapi/src/main/java/ca/uhn/fhir/rest/openapi/OpenApiInterceptor.java b/hapi-fhir-server-openapi/src/main/java/ca/uhn/fhir/rest/openapi/OpenApiInterceptor.java index 5a177a60cac..7caad2dbb78 100644 --- a/hapi-fhir-server-openapi/src/main/java/ca/uhn/fhir/rest/openapi/OpenApiInterceptor.java +++ b/hapi-fhir-server-openapi/src/main/java/ca/uhn/fhir/rest/openapi/OpenApiInterceptor.java @@ -385,6 +385,7 @@ public class OpenApiInterceptor { Paths paths = new Paths(); openApi.setPaths(paths); + if (page == null || page.equals(PAGE_SYSTEM) || page.equals(PAGE_ALL)) { Tag serverTag = new Tag(); serverTag.setName(PAGE_SYSTEM); @@ -397,7 +398,6 @@ public class OpenApiInterceptor { addFhirResourceResponse(ctx, openApi, capabilitiesOperation, "CapabilityStatement"); Set systemInteractions = cs.getRestFirstRep().getInteraction().stream().map(t -> t.getCode()).collect(Collectors.toSet()); - // Transaction Operation if (systemInteractions.contains(CapabilityStatement.SystemRestfulInteraction.TRANSACTION) || systemInteractions.contains(CapabilityStatement.SystemRestfulInteraction.BATCH)) { Operation transaction = getPathItem(paths, "/", PathItem.HttpMethod.POST); @@ -742,8 +742,9 @@ public class OpenApiInterceptor { } } - private Operation getPathItem(Paths thePaths, String thePath, PathItem.HttpMethod theMethod) { + protected Operation getPathItem(Paths thePaths, String thePath, PathItem.HttpMethod theMethod) { PathItem pathItem; + if (thePaths.containsKey(thePath)) { pathItem = thePaths.get(thePath); } else {