Class ResponseValidatingInterceptor
java.lang.Object
ca.uhn.fhir.rest.server.interceptor.ValidationResultEnrichingInterceptor
ca.uhn.fhir.rest.server.interceptor.BaseValidatingInterceptor<org.hl7.fhir.instance.model.api.IBaseResource>
ca.uhn.fhir.rest.server.interceptor.ResponseValidatingInterceptor
public class ResponseValidatingInterceptor
extends BaseValidatingInterceptor<org.hl7.fhir.instance.model.api.IBaseResource>
This interceptor intercepts each outgoing response and if it contains a FHIR resource, validates that resource. The interceptor may be configured to run any validator modules, and will then add
headers to the response or fail the request with an
HTTP 422 Unprocessable Entity
.-
Field Summary
Fields inherited from class ca.uhn.fhir.rest.server.interceptor.BaseValidatingInterceptor
DEFAULT_RESPONSE_HEADER_VALUE
Fields inherited from class ca.uhn.fhir.rest.server.interceptor.ValidationResultEnrichingInterceptor
REQUEST_VALIDATION_RESULT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addExcludeOperationType
(ca.uhn.fhir.rest.api.RestOperationTypeEnum theOperationType) Do not validate the following operations.boolean
outgoingResponse
(RequestDetails theRequestDetails, org.hl7.fhir.instance.model.api.IBaseResource theResponseObject) void
setResponseHeaderName
(String theResponseHeaderName) Sets the name of the response header to add validation failures toMethods inherited from class ca.uhn.fhir.rest.server.interceptor.BaseValidatingInterceptor
addValidatorModule, fail, getAddResponseOutcomeHeaderOnSeverity, getMaximumHeaderLength, getResponseOutcomeHeaderName, getValidatorModules, isIgnoreValidatorExceptions, postProcessResult, postProcessResultOnFailure, setAddResponseHeaderOnSeverity, setAddResponseOutcomeHeaderOnSeverity, setFailOnSeverity, setIgnoreValidatorExceptions, setMaximumHeaderLength, setResponseHeaderValue, setResponseHeaderValueNoIssues, setResponseOutcomeHeaderName, setValidator, setValidatorModules, validate
Methods inherited from class ca.uhn.fhir.rest.server.interceptor.ValidationResultEnrichingInterceptor
addValidationResultsToOperationOutcome, addValidationResultToRequestDetails
-
Field Details
-
DEFAULT_RESPONSE_HEADER_NAME
X-HAPI-Request-Validation- See Also:
-
-
Constructor Details
-
ResponseValidatingInterceptor
public ResponseValidatingInterceptor()
-
-
Method Details
-
addExcludeOperationType
Do not validate the following operations. A common use for this is to excludeRestOperationTypeEnum.METADATA
so that this operation will execute as quickly as possible. -
outgoingResponse
public boolean outgoingResponse(RequestDetails theRequestDetails, org.hl7.fhir.instance.model.api.IBaseResource theResponseObject) -
setResponseHeaderName
Sets the name of the response header to add validation failures to- Overrides:
setResponseHeaderName
in classBaseValidatingInterceptor<org.hl7.fhir.instance.model.api.IBaseResource>
- See Also:
-