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.annotation;
014
015import static java.lang.annotation.RetentionPolicy.*;
016
017import java.lang.annotation.*;
018
019/**
020 * Swagger external documentation annotation.
021 *
022 * <p>
023 * Allows referencing an external resource for extended documentation.
024 *
025 * <p>
026 * Used to populate the auto-generated Swagger documentation and UI for server-side <ja>@Rest</ja>-annotated classes.
027 *
028 * <h5 class='section'>Example:</h5>
029 * <p class='bjava'>
030 *    <ja>@Swagger</ja>(
031 *       externalDocs=<ja>@ExternalDocs</ja>(
032 *          description=<js>"Apache Juneau"</js>,
033 *          url=<js>"http://juneau.apache.org"</js>
034 *       )
035 *    )
036 * </p>
037 *
038 * <h5 class='section'>See Also:</h5><ul>
039 *    <li class='link'><a class="doclink" href="../../../../index.html#jd.Swagger">Swagger</a>
040 *    <li class='extlink'><a class="doclink" href="https://swagger.io/specification/v2#externalDocumentationObject">Swagger ExternalDocumentation Object</a>
041 * </ul>
042 */
043@Documented
044@Retention(RUNTIME)
045public @interface ExternalDocs {
046
047   /**
048    * <mk>description</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#externalDocumentationObject">Swagger ExternalDocumentation Object</a>.
049    *
050    * <p>
051    * A short description of the target documentation.
052    *
053    * <h5 class='section'>Notes:</h5><ul>
054    *    <li class='note'>
055    *       The format is a plain-text string.
056    *       <br>Multiple lines are concatenated with newlines.
057    *    <li class='note'>
058    *       Supports <a class="doclink" href="../../../../index.html#jrs.SvlVariables">SVL Variables</a> (e.g. <js>"$L{my.localized.variable}"</js>) for the swagger generator.
059    * </ul>
060    *
061    * @return The annotation value.
062    */
063   String[] description() default {};
064
065   /**
066    * <mk>url</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#externalDocumentationObject">Swagger ExternalDocumentation Object</a>.
067    *
068    * <p>
069    * The URL for the target documentation. Value MUST be in the format of a URL.
070    *
071    * <h5 class='section'>Notes:</h5><ul>
072    *    <li class='note'>
073    *       The value is required.
074    *    <li class='note'>
075    *       The format is a URL string.
076    *    <li class='note'>
077    *       Supports <a class="doclink" href="../../../../index.html#jrs.SvlVariables">SVL Variables</a> (e.g. <js>"$L{my.localized.variable}"</js>) for the swagger generator.
078    * </ul>
079    *
080    * @return The annotation value.
081    */
082   String url() default "";
083}