Class RequestValidatingInterceptor
java.lang.Object
ca.uhn.fhir.rest.server.interceptor.ValidationResultEnrichingInterceptor
ca.uhn.fhir.rest.server.interceptor.BaseValidatingInterceptor<String>
ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor
This interceptor intercepts each incoming request 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 TypeMethodDescriptionboolean
incomingRequestPostProcessed
(RequestDetails theRequestDetails, jakarta.servlet.http.HttpServletRequest theRequest, jakarta.servlet.http.HttpServletResponse theResponse) boolean
If set to true (default is true), the validation results will be added to the OperationOutcome being returned to the client, unless the response being returned is not an OperationOutcome to begin with (e.g.void
setAddValidationResultsToResponseOperationOutcome
(boolean theAddValidationResultsToResponseOperationOutcome) If set to true (default is true), the validation results will be added to the OperationOutcome being returned to the client, unless the response being returned is not an OperationOutcome to begin with (e.g.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
-
RequestValidatingInterceptor
public RequestValidatingInterceptor()
-
-
Method Details
-
incomingRequestPostProcessed
public boolean incomingRequestPostProcessed(RequestDetails theRequestDetails, jakarta.servlet.http.HttpServletRequest theRequest, jakarta.servlet.http.HttpServletResponse theResponse) throws ca.uhn.fhir.rest.server.exceptions.AuthenticationException - Throws:
ca.uhn.fhir.rest.server.exceptions.AuthenticationException
-
isAddValidationResultsToResponseOperationOutcome
If set to true (default is true), the validation results will be added to the OperationOutcome being returned to the client, unless the response being returned is not an OperationOutcome to begin with (e.g. if the client has requestedReturn: prefer=representation
) -
setAddValidationResultsToResponseOperationOutcome
public void setAddValidationResultsToResponseOperationOutcome(boolean theAddValidationResultsToResponseOperationOutcome) If set to true (default is true), the validation results will be added to the OperationOutcome being returned to the client, unless the response being returned is not an OperationOutcome to begin with (e.g. if the client has requestedReturn: prefer=representation
) -
setResponseHeaderName
Sets the name of the response header to add validation failures to- Overrides:
setResponseHeaderName
in classBaseValidatingInterceptor<String>
- See Also:
-