diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/Constants.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/Constants.java index d4adbe611f1..1961ded8c12 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/Constants.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/Constants.java @@ -60,11 +60,7 @@ public class Constants { public static final String CT_FHIR_JSON_NEW = "application/fhir+json"; public static final String CT_FHIR_XML = "application/xml+fhir"; - /** - * Special Conformance Formats that don't follow normal mediatype rules - */ - public static final String CT_JSON_RAW = "json"; - public static final String CT_XML_RAW = "xml"; + /** * The FHIR MimeType for XML encoding in FHIR DSTU3+ */ diff --git a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/rest/server/ServerCapabilityStatementProvider.java b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/rest/server/ServerCapabilityStatementProvider.java index e310cbd1afd..c01caf7a9db 100644 --- a/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/rest/server/ServerCapabilityStatementProvider.java +++ b/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/hapi/rest/server/ServerCapabilityStatementProvider.java @@ -224,8 +224,8 @@ public class ServerCapabilityStatementProvider extends BaseServerCapabilityState retVal.getSoftware().setVersion(serverConfiguration.getServerVersion()); retVal.addFormat(Constants.CT_FHIR_XML_NEW); retVal.addFormat(Constants.CT_FHIR_JSON_NEW); - retVal.addFormat(Constants.CT_JSON_RAW); - retVal.addFormat(Constants.CT_XML_RAW); + retVal.addFormat(Constants.FORMAT_JSON); + retVal.addFormat(Constants.FORMAT_XML); retVal.setStatus(PublicationStatus.ACTIVE); CapabilityStatementRestComponent rest = retVal.addRest(); diff --git a/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/hapi/rest/server/ServerCapabilityStatementProviderDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/hapi/rest/server/ServerCapabilityStatementProviderDstu3Test.java index 0e76ea984f2..7de10333d3f 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/hapi/rest/server/ServerCapabilityStatementProviderDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/hapi/rest/server/ServerCapabilityStatementProviderDstu3Test.java @@ -189,9 +189,9 @@ public class ServerCapabilityStatementProviderDstu3Test { List formatCodes = serverConformance.getFormat().stream().map(c -> c.asStringValue()).collect(Collectors.toList());; - assertThat(formatCodes, hasItem(ca.uhn.fhir.rest.api.Constants.CT_JSON_RAW)); - assertThat(formatCodes, hasItem(ca.uhn.fhir.rest.api.Constants.CT_XML_RAW)); - assertThat(formatCodes, hasItem(ca.uhn.fhir.rest.api.Constants.CT_FHIR_JSON_NEW)); + assertThat(formatCodes, hasItem(Constants.FORMAT_XML)); + assertThat(formatCodes, hasItem(Constants.FORMAT_JSON)); + assertThat(formatCodes, hasItem(Constants.CT_FHIR_JSON_NEW)); assertThat(formatCodes, hasItem(Constants.CT_FHIR_XML_NEW)); } diff --git a/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/hapi/rest/server/ServerCapabilityStatementProvider.java b/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/hapi/rest/server/ServerCapabilityStatementProvider.java index e2f3e6b75ac..fd72529be18 100644 --- a/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/hapi/rest/server/ServerCapabilityStatementProvider.java +++ b/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/hapi/rest/server/ServerCapabilityStatementProvider.java @@ -172,8 +172,8 @@ public class ServerCapabilityStatementProvider extends BaseServerCapabilityState retVal.getSoftware().setVersion(configuration.getServerVersion()); retVal.addFormat(Constants.CT_FHIR_XML_NEW); retVal.addFormat(Constants.CT_FHIR_JSON_NEW); - retVal.addFormat(Constants.CT_JSON_RAW); - retVal.addFormat(Constants.CT_XML_RAW); + retVal.addFormat(Constants.FORMAT_JSON); + retVal.addFormat(Constants.FORMAT_XML); retVal.setStatus(PublicationStatus.ACTIVE); CapabilityStatementRestComponent rest = retVal.addRest(); diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/ServerCapabilityStatementProviderR4Test.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/ServerCapabilityStatementProviderR4Test.java index 130f936a002..67aa2155d86 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/ServerCapabilityStatementProviderR4Test.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/ServerCapabilityStatementProviderR4Test.java @@ -541,10 +541,10 @@ public class ServerCapabilityStatementProviderR4Test { rs.init(createServletConfig()); CapabilityStatement serverConformance = sc.getServerConformance(createHttpServletRequest(), createRequestDetails(rs)); - List formatCodes = serverConformance.getFormat().stream().map(c -> c.getCode()).collect(Collectors.toList());; + List formatCodes = serverConformance.getFormat().stream().map(c -> c.getCode()).collect(Collectors.toList()); - assertThat(formatCodes, hasItem(Constants.CT_JSON_RAW)); - assertThat(formatCodes, hasItem(Constants.CT_XML_RAW)); + assertThat(formatCodes, hasItem(Constants.FORMAT_XML)); + assertThat(formatCodes, hasItem(Constants.FORMAT_JSON)); assertThat(formatCodes, hasItem(Constants.CT_FHIR_JSON_NEW)); assertThat(formatCodes, hasItem(Constants.CT_FHIR_XML_NEW)); } diff --git a/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/rest/server/ServerCapabilityStatementProvider.java b/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/rest/server/ServerCapabilityStatementProvider.java index bfcebaf073c..5fd5eaa56fb 100644 --- a/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/rest/server/ServerCapabilityStatementProvider.java +++ b/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/rest/server/ServerCapabilityStatementProvider.java @@ -184,8 +184,8 @@ public class ServerCapabilityStatementProvider extends BaseServerCapabilityState retVal.getSoftware().setVersion(configuration.getServerVersion()); retVal.addFormat(Constants.CT_FHIR_XML_NEW); retVal.addFormat(Constants.CT_FHIR_JSON_NEW); - retVal.addFormat(Constants.CT_JSON_RAW); - retVal.addFormat(Constants.CT_XML_RAW); + retVal.addFormat(Constants.FORMAT_JSON); + retVal.addFormat(Constants.FORMAT_XML); retVal.setStatus(PublicationStatus.ACTIVE); CapabilityStatementRestComponent rest = retVal.addRest(); diff --git a/hapi-fhir-structures-r5/src/test/java/ca/uhn/fhir/rest/server/ServerCapabilityStatementProviderR5Test.java b/hapi-fhir-structures-r5/src/test/java/ca/uhn/fhir/rest/server/ServerCapabilityStatementProviderR5Test.java index 08ee00e175f..1780bc2df1e 100644 --- a/hapi-fhir-structures-r5/src/test/java/ca/uhn/fhir/rest/server/ServerCapabilityStatementProviderR5Test.java +++ b/hapi-fhir-structures-r5/src/test/java/ca/uhn/fhir/rest/server/ServerCapabilityStatementProviderR5Test.java @@ -214,9 +214,9 @@ public class ServerCapabilityStatementProviderR5Test { List formatCodes = serverConformance.getFormat().stream().map(c -> c.getCode()).collect(Collectors.toList());; - assertThat(formatCodes, hasItem(ca.uhn.fhir.rest.api.Constants.CT_JSON_RAW)); - assertThat(formatCodes, hasItem(ca.uhn.fhir.rest.api.Constants.CT_XML_RAW)); - assertThat(formatCodes, hasItem(ca.uhn.fhir.rest.api.Constants.CT_FHIR_JSON_NEW)); + assertThat(formatCodes, hasItem(Constants.FORMAT_XML)); + assertThat(formatCodes, hasItem(Constants.FORMAT_JSON)); + assertThat(formatCodes, hasItem(Constants.CT_FHIR_JSON_NEW)); assertThat(formatCodes, hasItem(Constants.CT_FHIR_XML_NEW)); }