001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.juneau.annotation;
018
019import static java.lang.annotation.RetentionPolicy.*;
020
021import java.lang.annotation.*;
022
023/**
024 * Swagger external documentation annotation.
025 *
026 * <p>
027 * Allows referencing an external resource for extended documentation.
028 *
029 * <p>
030 * Used to populate the auto-generated Swagger documentation and UI for server-side <ja>@Rest</ja>-annotated classes.
031 *
032 * <h5 class='section'>Example:</h5>
033 * <p class='bjava'>
034 *    <ja>@Swagger</ja>(
035 *       externalDocs=<ja>@ExternalDocs</ja>(
036 *          description=<js>"Apache Juneau"</js>,
037 *          url=<js>"http://juneau.apache.org"</js>
038 *       )
039 *    )
040 * </p>
041 *
042 * <h5 class='section'>See Also:</h5><ul>
043 *    <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauBeanSwagger2">juneau-bean-swagger-v2</a>
044 *    <li class='extlink'><a class="doclink" href="https://swagger.io/specification/v2#externalDocumentationObject">Swagger ExternalDocumentation Object</a>
045 * </ul>
046 */
047@Documented
048@Retention(RUNTIME)
049public @interface ExternalDocs {
050
051   /**
052    * <mk>description</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#externalDocumentationObject">Swagger ExternalDocumentation Object</a>.
053    *
054    * <p>
055    * A short description of the target documentation.
056    *
057    * <h5 class='section'>Notes:</h5><ul>
058    *    <li class='note'>
059    *       The format is a plain-text string.
060    *       <br>Multiple lines are concatenated with newlines.
061    *    <li class='note'>
062    *       Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/RestServerSvlVariables">SVL Variables</a> (e.g. <js>"$L{my.localized.variable}"</js>) for the swagger generator.
063    * </ul>
064    *
065    * @return The annotation value.
066    */
067   String[] description() default {};
068
069   /**
070    * <mk>url</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#externalDocumentationObject">Swagger ExternalDocumentation Object</a>.
071    *
072    * <p>
073    * The URL for the target documentation. Value MUST be in the format of a URL.
074    *
075    * <h5 class='section'>Notes:</h5><ul>
076    *    <li class='note'>
077    *       The value is required.
078    *    <li class='note'>
079    *       The format is a URL string.
080    *    <li class='note'>
081    *       Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/RestServerSvlVariables">SVL Variables</a> (e.g. <js>"$L{my.localized.variable}"</js>) for the swagger generator.
082    * </ul>
083    *
084    * @return The annotation value.
085    */
086   String url() default "";
087}