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.http.annotation;
018
019import static java.lang.annotation.RetentionPolicy.*;
020
021import java.lang.annotation.*;
022
023/**
024 * Swagger license annotation.
025 *
026 * <p>
027 * License information for the exposed API.
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 *       license=<ja>@License</ja>(
036 *          name=<js>"Apache 2.0"</js>,
037 *          url=<js>"http://www.apache.org/licenses/LICENSE-2.0.html"</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#licenseObject">Swagger License Object</a>
045
046 * </ul>
047 */
048@Documented
049@Retention(RUNTIME)
050public @interface License {
051
052    /**
053     * Optional description for the exposed API.
054     *
055     * @return The annotation value.
056     * @since 9.2.0
057     */
058    String[] description() default {};
059
060   /**
061    * <mk>name</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#licenseObject">Swagger License Object</a>.
062    *
063    * <h5 class='section'>Notes:</h5><ul>
064    *    <li class='note'>
065    *       The format is a plain-text string.
066    *    <li class='note'>
067    *       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.
068    * </ul>
069    *
070    * @return The annotation value.
071    */
072   String name() default "";
073
074   /**
075    * <mk>url</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#licenseObject">Swagger License Object</a>.
076    *
077    * <h5 class='section'>Notes:</h5><ul>
078    *    <li class='note'>
079    *       The format is a plain-text 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}