001// ***************************************************************************************************************************
002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
003// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
005// * with the License.  You may obtain a copy of the License at                                                              *
006// *                                                                                                                         *
007// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
008// *                                                                                                                         *
009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
011// * specific language governing permissions and limitations under the License.                                              *
012// ***************************************************************************************************************************
013package org.apache.juneau.rest.annotation;
014
015import static java.lang.annotation.ElementType.*;
016import static java.lang.annotation.RetentionPolicy.*;
017
018import java.lang.annotation.*;
019
020import org.apache.juneau.rest.*;
021
022/**
023 * @deprecated Use {@link org.apache.juneau.http.annotation.Response}
024 */
025@Deprecated
026@Documented
027@Target(PARAMETER)
028@Retention(RUNTIME)
029@Inherited
030public @interface Response {
031
032   /**
033    * Optional description.
034    *
035    * <p>
036    * The default value pulls the description from the <code>description</code> entry in the servlet resource bundle.
037    * (e.g. <js>"myMethod.res.[code].description = foo"</js> or
038    * <js>"MyServlet.myMethod.res.[code].description = foo"</js>).
039    *
040    * <p>
041    * This field can contain variables (e.g. "$L{my.localized.variable}").
042    * <br>See {@link RestContext#getVarResolver()} for the list of supported variables.
043    *
044    * <p>
045    * Corresponds to the swagger field <code>/paths/{path}/{method}/responses/{code}/description</code>.
046    */
047   String description() default "";
048
049   /**
050    * Optional response headers.
051    *
052    * <p>
053    * Response variables can also be defined in the servlet resource bundle.
054    * (e.g. <js>"myMethod.res.[code].[category].[name] = foo"</js> or
055    * <js>"MyServlet.myMethod.res.[code].[category].[name] = foo"</js>).
056    */
057   Parameter[] headers() default {};
058
059   /**
060    * A definition of the response structure.
061    *
062    * <p>
063    * It can be a primitive, an array or an object.
064    * If this field does not exist, it means no content is returned as part of the response.
065    * As an extension to the <a class="doclink" href="http://swagger.io/specification/#schemaObject">Schema Object</a>,
066    * its root type value may also be <js>"file"</js>.
067    * This SHOULD be accompanied by a relevant produces mime-type.
068    *
069    * <h5 class='section'>Example:</h5>
070    * <p class='bcode'>
071    *    <ja>@RestMethod</ja>(
072    *       name=<js>"*"</js>,
073    *       swagger=@MethodSwagger(
074    *          responses={
075    *             <ja>@Response</ja>(value=200,schema=<js>"{type:'string',description:'A serialized Person bean.'}"</js>),
076    *          }
077    *       )
078    * </p>
079    */
080   String schema() default "";
081
082   /**
083    * HTTP response code.
084    */
085   int value();
086}