Merge pull request from hapifhir/issue-2904-Swagger-ui-Doesn't-Work-with-Partitions

Issue 2904 swagger UI doesn't work with partitions
This commit is contained in:
Tadgh 2021-08-24 17:43:46 -04:00 committed by GitHub
commit d34b0ff093
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions
hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0
hapi-fhir-server-openapi/src/main/java/ca/uhn/fhir/rest/openapi

View File

@ -0,0 +1,4 @@
---
type: change
issue: 2904
title: "Change getPathItem method in OpenApiInterceptor from private to protected"

View File

@ -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<CapabilityStatement.SystemRestfulInteraction> 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 {