001package ca.uhn.fhir.rest.annotation;
002
003/*
004 * #%L
005 * HAPI FHIR - Core Library
006 * %%
007 * Copyright (C) 2014 - 2021 Smile CDR, Inc.
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 *
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 *
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023import java.lang.annotation.ElementType;
024import java.lang.annotation.Retention;
025import java.lang.annotation.RetentionPolicy;
026import java.lang.annotation.Target;
027
028/**
029 * Denotes a parameter for a REST method which will contain the resource actually
030 * being created/updated/etc in an operation which contains a resource in the HTTP request.
031 * <p>
032 * For example, in a {@link Create} operation the method parameter annotated with this
033 * annotation will contain the actual resource being created.
034 * </p>
035 * <p>
036 * Parameters with this annotation should typically be of the type of resource being
037 * operated on (see below for an exception when raw data is required). For example, in a
038 * IResourceProvider for Patient resources, the parameter annotated with this
039 * annotation should be of type Patient.
040 * </p>
041 * <p>
042 * Note that in servers it is also acceptable to have parameters with this annotation
043 * which are of type {@link String} or of type <code>byte[]</code>. Parameters of
044 * these types will contain the raw/unparsed HTTP request body. It is fine to
045 * have multiple parameters with this annotation, so you can have one parameter
046 * which accepts the parsed resource, and another which accepts the raw request.
047 * </p>
048 * <p>
049 * Also note that this parameter may be null if a client does not supply a body.
050 * </p>
051 */
052@Target(value = ElementType.PARAMETER)
053@Retention(RetentionPolicy.RUNTIME)
054public @interface ResourceParam {
055
056}