From 472984ac65cbf3e9076652cd9dabccf66e1655a9 Mon Sep 17 00:00:00 2001 From: Martha Mitran Date: Tue, 18 Jun 2024 14:57:04 -0700 Subject: [PATCH] Document pointcut to use to modify request parameters (#6019) * Document pointcut to use to modify request parameters. Add a test to exemplify. * Add another alternate pointcut to use --- .../ca/uhn/fhir/interceptor/api/Pointcut.java | 17 ++++---- .../provider/r4/ResourceProviderR4Test.java | 43 +++++++++++++++++-- 2 files changed, 49 insertions(+), 11 deletions(-) diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/Pointcut.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/Pointcut.java index 016512e537d..cac6a1725a6 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/Pointcut.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/Pointcut.java @@ -321,9 +321,12 @@ public enum Pointcut implements IPointcut { * This hook is invoked before an incoming request is processed. Note that this method is called * after the server has begun preparing the response to the incoming client request. * As such, it is not able to supply a response to the incoming request in the way that - * SERVER_INCOMING_REQUEST_PRE_PROCESSED and - * {@link #SERVER_INCOMING_REQUEST_POST_PROCESSED} - * are. + * SERVER_INCOMING_REQUEST_PRE_PROCESSED and {@link #SERVER_INCOMING_REQUEST_POST_PROCESSED} are. + * At this point the request has already been passed to the handler so any changes + * (e.g. adding parameters) will not be considered. + * If you'd like to modify request parameters before they are passed to the handler, + * use {@link Pointcut#SERVER_INCOMING_REQUEST_PRE_HANDLER_SELECTED} or {@link Pointcut#SERVER_INCOMING_REQUEST_POST_PROCESSED}. + * If you are attempting to modify a search before it occurs, use {@link Pointcut#STORAGE_PRESEARCH_REGISTERED}. *

* Hooks may accept the following parameters: *