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.http.annotation; 014 015import static java.lang.annotation.RetentionPolicy.*; 016 017import java.lang.annotation.*; 018 019/** 020 * Swagger license annotation. 021 * 022 * <p> 023 * License information for the exposed API. 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 * license=<ja>@License</ja>( 032 * name=<js>"Apache 2.0"</js>, 033 * url=<js>"http://www.apache.org/licenses/LICENSE-2.0.html"</js> 034 * ) 035 * ) 036 * </p> 037 * 038 * <h5 class='section'>See Also:</h5><ul> 039 * <li class='link'><a class="doclink" href="../../../../../index.html#jrs.Swagger">Swagger</a> 040 * <li class='extlink'><a class="doclink" href="https://swagger.io/specification/v2#licenseObject">Swagger License Object</a> 041 042 * </ul> 043 */ 044@Documented 045@Retention(RUNTIME) 046public @interface License { 047 048 /** 049 * <mk>name</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#licenseObject">Swagger License Object</a>. 050 * 051 * <h5 class='section'>Notes:</h5><ul> 052 * <li class='note'> 053 * The format is a plain-text string. 054 * <li class='note'> 055 * Supports <a class="doclink" href="../../../../../index.html#jrs.SvlVariables">SVL Variables</a> (e.g. <js>"$L{my.localized.variable}"</js>) for the swagger generator. 056 * </ul> 057 * 058 * @return The annotation value. 059 */ 060 String name() default ""; 061 062 /** 063 * <mk>url</mk> field of the <a class="doclink" href="https://swagger.io/specification/v2#licenseObject">Swagger License Object</a>. 064 * 065 * <h5 class='section'>Notes:</h5><ul> 066 * <li class='note'> 067 * The format is a plain-text string. 068 * <li class='note'> 069 * Supports <a class="doclink" href="../../../../../index.html#jrs.SvlVariables">SVL Variables</a> (e.g. <js>"$L{my.localized.variable}"</js>) for the swagger generator. 070 * </ul> 071 * 072 * @return The annotation value. 073 */ 074 String url() default ""; 075}