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.rest.annotation; 018 019import static java.lang.annotation.ElementType.*; 020import static java.lang.annotation.RetentionPolicy.*; 021 022import java.lang.annotation.*; 023import java.nio.charset.*; 024 025import org.apache.juneau.annotation.*; 026import org.apache.juneau.bean.swagger.*; 027import org.apache.juneau.encoders.*; 028import org.apache.juneau.rest.*; 029import org.apache.juneau.rest.guard.*; 030import org.apache.juneau.rest.httppart.*; 031import org.apache.juneau.rest.matcher.*; 032import org.apache.juneau.rest.servlet.*; 033import org.apache.juneau.rest.swagger.*; 034 035/** 036 * Identifies a REST DELETE operation Java method on a {@link RestServlet} implementation class. 037 * 038 * <p> 039 * This is a specialized subtype of <c><ja>{@link RestOp @RestOp}(method=<jsf>DELETE</jsf>)</c>. 040 * 041 * <h5 class='section'>See Also:</h5><ul> 042 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/RestOpAnnotatedMethodBasics">@RestOp-Annotated Method Basics</a> 043 044 * </ul> 045 */ 046@Target(METHOD) 047@Retention(RUNTIME) 048@Inherited 049@ContextApply(RestDeleteAnnotation.RestOpContextApply.class) 050@AnnotationGroup(RestOp.class) 051public @interface RestDelete { 052 053 /** 054 * Specifies whether this method can be called based on the client version. 055 * 056 * <p> 057 * The client version is identified via the HTTP request header identified by 058 * {@link Rest#clientVersionHeader() @Rest(clientVersionHeader)} which by default is <js>"Client-Version"</js>. 059 * 060 * <p> 061 * This is a specialized kind of {@link RestMatcher} that allows you to invoke different Java methods for the same 062 * method/path based on the client version. 063 * 064 * <p> 065 * The format of the client version range is similar to that of OSGi versions. 066 * 067 * <p> 068 * In the following example, the Java methods are mapped to the same HTTP method and URL <js>"/foobar"</js>. 069 * <p class='bjava'> 070 * <jc>// Call this method if Client-Version is at least 2.0. 071 * // Note that this also matches 2.0.1.</jc> 072 * <ja>@RestDelete</ja>(path=<js>"/foobar"</js>, clientVersion=<js>"2.0"</js>) 073 * <jk>public</jk> Object method1() {...} 074 * 075 * <jc>// Call this method if Client-Version is at least 1.1, but less than 2.0.</jc> 076 * <ja>@RestDelete</ja>(path=<js>"/foobar"</js>, clientVersion=<js>"[1.1,2.0)"</js>) 077 * <jk>public</jk> Object method2() {...} 078 * 079 * <jc>// Call this method if Client-Version is less than 1.1.</jc> 080 * <ja>@RestDelete</ja>(path=<js>"/foobar"</js>, clientVersion=<js>"[0,1.1)"</js>) 081 * <jk>public</jk> Object method3() {...} 082 * </p> 083 * 084 * <p> 085 * It's common to combine the client version with transforms that will convert new POJOs into older POJOs for 086 * backwards compatibility. 087 * <p class='bjava'> 088 * <jc>// Call this method if Client-Version is at least 2.0.</jc> 089 * <ja>@RestDelete</ja>(path=<js>"/foobar"</js>, clientVersion=<js>"2.0"</js>) 090 * <jk>public void</jk> newMethod() {...} 091 * 092 * <jc>// Call this method if Client-Version is at least 1.1, but less than 2.0.</jc> 093 * <ja>@RestDelete</ja>(path=<js>"/foobar"</js>, clientVersion=<js>"[1.1,2.0)"</js>}) 094 * <jk>public void</jk> oldMethod() {...} 095 * </p> 096 * 097 * <p> 098 * Note that in the previous example, we're returning the exact same POJO, but using a transform to convert it into 099 * an older form. 100 * The old method could also just return back a completely different object. 101 * The range can be any of the following: 102 * <ul> 103 * <li><js>"[0,1.0)"</js> = Less than 1.0. 1.0 and 1.0.0 does not match. 104 * <li><js>"[0,1.0]"</js> = Less than or equal to 1.0. Note that 1.0.1 will match. 105 * <li><js>"1.0"</js> = At least 1.0. 1.0 and 2.0 will match. 106 * </ul> 107 * 108 * <h5 class='section'>See Also:</h5><ul> 109 * <li class='jm'>{@link org.apache.juneau.rest.RestContext.Builder#clientVersionHeader(String)} 110 * </ul> 111 * 112 * @return The annotation value. 113 */ 114 String clientVersion() default ""; 115 116 /** 117 * Enable debug mode. 118 * 119 * <p> 120 * Enables the following: 121 * <ul class='spaced-list'> 122 * <li> 123 * HTTP request/response bodies are cached in memory for logging purposes. 124 * <li> 125 * Request/response messages are automatically logged. 126 * </ul> 127 * 128 * <ul class='values'> 129 * <li><js>"true"</js> - Debug is enabled for all requests. 130 * <li><js>"false"</js> - Debug is disabled for all requests. 131 * <li><js>"conditional"</js> - Debug is enabled only for requests that have a <c class='snippet'>Debug: true</c> header. 132 * <li><js>""</js> (or anything else) - Debug mode is inherited from class. 133 * </ul> 134 * 135 * <h5 class='section'>Notes:</h5><ul> 136 * <li class='note'> 137 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/RestServerSvlVariables">SVL Variables</a> 138 * (e.g. <js>"$L{my.localized.variable}"</js>). 139 * </ul> 140 * 141 * <h5 class='section'>See Also:</h5><ul> 142 * <li class='jm'>{@link org.apache.juneau.rest.RestContext.Builder#debugEnablement()} 143 * </ul> 144 * 145 * @return The annotation value. 146 */ 147 String debug() default ""; 148 149 /** 150 * Default <c>Accept</c> header. 151 * 152 * <p> 153 * The default value for the <c>Accept</c> header if not specified on a request. 154 * 155 * <p> 156 * This is a shortcut for using {@link #defaultRequestHeaders()} for just this specific header. 157 * 158 * @return The annotation value. 159 */ 160 String defaultAccept() default ""; 161 162 /** 163 * Default character encoding. 164 * 165 * <p> 166 * The default character encoding for the request and response if not specified on the request. 167 * 168 * <h5 class='section'>Notes:</h5><ul> 169 * <li class='note'> 170 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/RestServerSvlVariables">SVL Variables</a> 171 * (e.g. <js>"$S{mySystemProperty}"</js>). 172 * </ul> 173 * 174 * <h5 class='section'>See Also:</h5><ul> 175 * <li class='jm'>{@link org.apache.juneau.rest.RestContext.Builder#defaultCharset(Charset)} 176 * <li class='jm'>{@link org.apache.juneau.rest.RestOpContext.Builder#defaultCharset(Charset)} 177 * <li class='ja'>{@link Rest#defaultCharset} 178 * </ul> 179 * 180 * @return The annotation value. 181 */ 182 String defaultCharset() default ""; 183 184 /** 185 * Specifies default values for query parameters. 186 * 187 * <p> 188 * Strings are of the format <js>"name=value"</js>. 189 * 190 * <p> 191 * Affects values returned by {@link RestRequest#getQueryParam(String)} when the parameter is not present on the request. 192 * 193 * <h5 class='section'>Example:</h5> 194 * <p class='bjava'> 195 * <ja>@RestDelete</ja>(path=<js>"/*"</js>, defaultRequestQueryData={<js>"foo=bar"</js>}) 196 * <jk>public</jk> String doDelete(<ja>@Query</ja>(<js>"foo"</js>) String <jv>foo</jv>) {...} 197 * </p> 198 * 199 * <h5 class='section'>Notes:</h5><ul> 200 * <li class='note'> 201 * You can use either <js>':'</js> or <js>'='</js> as the key/value delimiter. 202 * <li class='note'> 203 * Key and value is trimmed of whitespace. 204 * <li class='note'> 205 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/RestServerSvlVariables">SVL Variables</a> 206 * (e.g. <js>"$S{mySystemProperty}"</js>). 207 * </ul> 208 * 209 * @return The annotation value. 210 */ 211 String[] defaultRequestQueryData() default {}; 212 213 /** 214 * Default request attributes. 215 * 216 * <p> 217 * Specifies default values for request attributes if they're not already set on the request. 218 * 219 * <p> 220 * Affects values returned by the following methods: 221 * <ul> 222 * <li class='jm'>{@link RestRequest#getAttribute(String)}. 223 * <li class='jm'>{@link RestRequest#getAttributes()}. 224 * </ul> 225 * 226 * <h5 class='section'>Example:</h5> 227 * <p class='bjava'> 228 * <jc>// Defined via annotation resolving to a config file setting with default value.</jc> 229 * <ja>@Rest</ja>(defaultRequestAttributes={<js>"Foo=bar"</js>, <js>"Baz: $C{REST/myAttributeValue}"</js>}) 230 * <jk>public class</jk> MyResource { 231 * 232 * <jc>// Override at the method level.</jc> 233 * <ja>@RestGet</ja>(defaultRequestAttributes={<js>"Foo: bar"</js>}) 234 * <jk>public</jk> Object myMethod() {...} 235 * } 236 * </p> 237 * 238 * </ul> 239 * <h5 class='section'>Notes:</h5><ul> 240 * <li class='note'> 241 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/RestServerSvlVariables">SVL Variables</a> 242 * (e.g. <js>"$L{my.localized.variable}"</js>). 243 * </ul> 244 * 245 * <h5 class='section'>See Also:</h5><ul> 246 * <li class='jm'>{@link org.apache.juneau.rest.RestContext.Builder#defaultRequestAttributes(NamedAttribute...)} 247 * <li class='ja'>{@link Rest#defaultRequestAttributes()} 248 * </ul> 249 * 250 * @return The annotation value. 251 */ 252 String[] defaultRequestAttributes() default {}; 253 254 /** 255 * Default request headers. 256 * 257 * <p> 258 * Specifies default values for request headers if they're not passed in through the request. 259 * 260 * <h5 class='section'>Example:</h5> 261 * <p class='bjava'> 262 * <jc>// Assume "text/json" Accept value when Accept not specified</jc> 263 * <ja>@RestDelete</ja>(path=<js>"/*"</js>, defaultRequestHeaders={<js>"Accept: text/json"</js>}) 264 * <jk>public</jk> String doDelete() {...} 265 * </p> 266 * 267 * <h5 class='section'>Notes:</h5><ul> 268 * <li class='note'> 269 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/RestServerSvlVariables">SVL Variables</a> 270 * (e.g. <js>"$S{mySystemProperty}"</js>). 271 * </ul> 272 * 273 * <h5 class='section'>See Also:</h5><ul> 274 * <li class='jm'>{@link org.apache.juneau.rest.RestContext.Builder#defaultRequestHeaders(org.apache.http.Header...)} 275 * </ul> 276 * 277 * @return The annotation value. 278 */ 279 String[] defaultRequestHeaders() default {}; 280 281 /** 282 * Default response headers. 283 * 284 * <p> 285 * Specifies default values for response headers if they're not overwritten during the request. 286 * 287 * <h5 class='section'>Example:</h5> 288 * <p class='bjava'> 289 * <jc>// Assume "text/json" Accept value when Accept not specified</jc> 290 * <ja>@RestDelete</ja>(path=<js>"/*"</js>, defaultResponseHeaders={<js>"Content-Type: text/json"</js>}) 291 * <jk>public</jk> String doDelete() {...} 292 * </p> 293 * 294 * <h5 class='section'>Notes:</h5><ul> 295 * <li class='note'> 296 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/RestServerSvlVariables">SVL Variables</a> 297 * (e.g. <js>"$S{mySystemProperty}"</js>). 298 * </ul> 299 * 300 * <h5 class='section'>See Also:</h5><ul> 301 * <li class='jm'>{@link org.apache.juneau.rest.RestContext.Builder#defaultResponseHeaders(org.apache.http.Header...)} 302 * </ul> 303 * 304 * @return The annotation value. 305 */ 306 String[] defaultResponseHeaders() default {}; 307 308 /** 309 * Optional description for the exposed API. 310 * 311 * <p> 312 * This description is used in the following locations: 313 * <ul class='spaced-list'> 314 * <li> 315 * The value returned by {@link Operation#getDescription()} in the auto-generated swagger. 316 * <li> 317 * The <js>"$RS{operationDescription}"</js> variable. 318 * <li> 319 * The description of the method in the Swagger page. 320 * </ul> 321 * 322 * <h5 class='section'>Notes:</h5><ul> 323 * <li class='note'> 324 * Corresponds to the swagger field <c>/paths/{path}/{method}/description</c>. 325 * <li class='note'> 326 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/RestServerSvlVariables">SVL Variables</a> 327 * (e.g. <js>"$L{my.localized.variable}"</js>). 328 * </ul> 329 * 330 * @return The annotation value. 331 */ 332 String[] description() default {}; 333 334 /** 335 * Specifies the compression encoders for this method. 336 * 337 * <p> 338 * Encoders are used to enable various kinds of compression (e.g. <js>"gzip"</js>) on requests and responses. 339 * 340 * <p> 341 * This value overrides encoders specified at the class level using {@link Rest#encoders()}. 342 * The {@link org.apache.juneau.encoders.EncoderSet.Inherit} class can be used to include values from the parent class. 343 * 344 * <h5 class='section'>Example:</h5> 345 * <p class='bjava'> 346 * <jc>// Define a REST resource that handles GZIP compression.</jc> 347 * <ja>@Rest</ja>( 348 * encoders={ 349 * GzipEncoder.<jk>class</jk> 350 * } 351 * ) 352 * <jk>public class</jk> MyResource { 353 * 354 * <jc>// Define a REST method that can also use a custom encoder.</jc> 355 * <ja>@RestDelete</ja>( 356 * encoders={ 357 * EncoderSet.Inherit.<jk>class</jk>, MyEncoder.<jk>class</jk> 358 * } 359 * ) 360 * <jk>public</jk> String doDelete() { 361 * ... 362 * } 363 * } 364 * </p> 365 * 366 * <p> 367 * The programmatic equivalent to this annotation is: 368 * <p class='bjava'> 369 * RestOpContext.Builder <jv>builder</jv> = RestOpContext.<jsm>create</jsm>(<jv>method</jv>,<jv>restContext</jv>); 370 * <jv>builder</jv>.getEncoders().set(<jv>classes</jv>); 371 * </p> 372 * 373 * <h5 class='section'>See Also:</h5><ul> 374 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/RestServerEncoders">Encoders</a> 375 * </ul> 376 * 377 * @return The annotation value. 378 */ 379 Class<? extends Encoder>[] encoders() default {}; 380 381 /** 382 * Method-level guards. 383 * 384 * <p> 385 * Associates one or more {@link RestGuard RestGuards} with this method. 386 * 387 * <h5 class='section'>See Also:</h5><ul> 388 * <li class='jm'>{@link org.apache.juneau.rest.RestOpContext.Builder#guards()} 389 * </ul> 390 * 391 * @return The annotation value. 392 */ 393 Class<? extends RestGuard>[] guards() default {}; 394 395 /** 396 * Method matchers. 397 * 398 * <p> 399 * Associates one more more {@link RestMatcher RestMatchers} with this method. 400 * 401 * <p> 402 * Matchers are used to allow multiple Java methods to handle requests assigned to the same URL path pattern, but 403 * differing based on some request attribute, such as a specific header value. 404 * 405 * <h5 class='section'>See Also:</h5><ul> 406 * <li class='jac'>{@link RestMatcher} 407 * </ul> 408 * 409 * @return The annotation value. 410 */ 411 Class<? extends RestMatcher>[] matchers() default {}; 412 413 /** 414 * Dynamically apply this annotation to the specified methods. 415 * 416 * <h5 class='section'>See Also:</h5><ul> 417 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/DynamicallyAppliedAnnotations">Dynamically Applied Annotations</a> 418 * </ul> 419 * 420 * @return The annotation value. 421 */ 422 String[] on() default {}; 423 424 /** 425 * Optional path pattern for the specified method. 426 * 427 * <p> 428 * Appending <js>"/*"</js> to the end of the path pattern will make it match any remainder too. 429 * <br>Not appending <js>"/*"</js> to the end of the pattern will cause a 404 (Not found) error to occur if the exact 430 * pattern is not found. 431 * 432 * <p> 433 * The path can contain variables that get resolved to {@link org.apache.juneau.http.annotation.Path @Path} parameters. 434 * 435 * <h5 class='figure'>Examples:</h5> 436 * <p class='bjava'> 437 * <ja>@RestDelete</ja>(path=<js>"/myurl/{foo}/{bar}/{baz}/*"</js>) 438 * </p> 439 * <p class='bjava'> 440 * <ja>@RestDelete</ja>(path=<js>"/myurl/{0}/{1}/{2}/*"</js>) 441 * </p> 442 * 443 * <p> 444 * Note that you can also use {@link #value()} to specify the path. 445 * 446 * <h5 class='section'>See Also:</h5><ul> 447 * <li class='ja'>{@link org.apache.juneau.http.annotation.Path} 448 * </ul> 449 * 450 * @return The annotation value. 451 */ 452 String[] path() default {}; 453 454 /** 455 * Role guard. 456 * 457 * <p> 458 * An expression defining if a user with the specified roles are allowed to access this method. 459 * 460 * <h5 class='section'>Example:</h5> 461 * <p class='bjava'> 462 * <jk>public class</jk> MyResource <jk>extends</jk> BasicRestServlet { 463 * 464 * <ja>@RestDelete</ja>( 465 * path=<js>"/foo"</js>, 466 * roleGuard=<js>"ROLE_ADMIN || (ROLE_READ_WRITE && ROLE_SPECIAL)"</js> 467 * ) 468 * <jk>public</jk> Object doDelete() { 469 * } 470 * } 471 * </p> 472 * 473 * <h5 class='section'>Notes:</h5><ul> 474 * <li class='note'> 475 * Supports any of the following expression constructs: 476 * <ul> 477 * <li><js>"foo"</js> - Single arguments. 478 * <li><js>"foo,bar,baz"</js> - Multiple OR'ed arguments. 479 * <li><js>"foo | bar | baz"</js> - Multiple OR'ed arguments, pipe syntax. 480 * <li><js>"foo || bar || baz"</js> - Multiple OR'ed arguments, Java-OR syntax. 481 * <li><js>"fo*"</js> - Patterns including <js>'*'</js> and <js>'?'</js>. 482 * <li><js>"fo* & *oo"</js> - Multiple AND'ed arguments, ampersand syntax. 483 * <li><js>"fo* && *oo"</js> - Multiple AND'ed arguments, Java-AND syntax. 484 * <li><js>"fo* || (*oo || bar)"</js> - Parenthesis. 485 * </ul> 486 * <li class='note'> 487 * AND operations take precedence over OR operations (as expected). 488 * <li class='note'> 489 * Whitespace is ignored. 490 * <li class='note'> 491 * <jk>null</jk> or empty expressions always match as <jk>false</jk>. 492 * <li class='note'> 493 * If patterns are used, you must specify the list of declared roles using {@link #rolesDeclared()} or {@link org.apache.juneau.rest.RestOpContext.Builder#rolesDeclared(String...)}. 494 * <li class='note'> 495 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/RestServerSvlVariables">SVL Variables</a> 496 * (e.g. <js>"$L{my.localized.variable}"</js>). 497 * <li class='note'> 498 * When defined on parent/child classes and methods, ALL guards within the hierarchy must pass. 499 * </ul> 500 * 501 * <h5 class='section'>See Also:</h5><ul> 502 * <li class='jm'>{@link org.apache.juneau.rest.RestOpContext.Builder#roleGuard(String)} 503 * </ul> 504 * 505 * @return The annotation value. 506 */ 507 String roleGuard() default ""; 508 509 /** 510 * Declared roles. 511 * 512 * <p> 513 * A comma-delimited list of all possible user roles. 514 * 515 * <p> 516 * Used in conjunction with {@link #roleGuard()} is used with patterns. 517 * 518 * <h5 class='section'>Example:</h5> 519 * <p class='bjava'> 520 * <jk>public class</jk> MyResource <jk>extends</jk> BasicRestServlet { 521 * 522 * <ja>@RestDelete</ja>( 523 * path=<js>"/foo"</js>, 524 * rolesDeclared=<js>"ROLE_ADMIN,ROLE_READ_WRITE,ROLE_READ_ONLY,ROLE_SPECIAL"</js>, 525 * roleGuard=<js>"ROLE_ADMIN || (ROLE_READ_WRITE && ROLE_SPECIAL)"</js> 526 * ) 527 * <jk>public</jk> Object doDelete() { 528 * } 529 * } 530 * </p> 531 * 532 * <h5 class='section'>See Also:</h5><ul> 533 * <li class='jm'>{@link org.apache.juneau.rest.RestOpContext.Builder#rolesDeclared(String...)} 534 * </ul> 535 * 536 * @return The annotation value. 537 */ 538 String rolesDeclared() default ""; 539 540 /** 541 * Optional summary for the exposed API. 542 * 543 * <p> 544 * This summary is used in the following locations: 545 * <ul class='spaced-list'> 546 * <li> 547 * The value returned by {@link Operation#getSummary()} in the auto-generated swagger. 548 * <li> 549 * The <js>"$RS{operationSummary}"</js> variable. 550 * <li> 551 * The summary of the method in the Swagger page. 552 * </ul> 553 * 554 * <h5 class='section'>Notes:</h5><ul> 555 * <li class='note'> 556 * Corresponds to the swagger field <c>/paths/{path}/{method}/summary</c>. 557 * <li class='note'> 558 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/RestServerSvlVariables">SVL Variables</a> 559 * (e.g. <js>"$L{my.localized.variable}"</js>). 560 * </ul> 561 * 562 * @return The annotation value. 563 */ 564 String summary() default ""; 565 566 /** 567 * Provides swagger-specific metadata on this method. 568 * 569 * <p> 570 * Used to populate the auto-generated OPTIONS swagger documentation. 571 * 572 * <p> 573 * The format of this annotation is JSON when all individual parts are concatenated. 574 * <br>The starting and ending <js>'{'</js>/<js>'}'</js> characters around the entire value are optional. 575 * 576 * <h5 class='section'>Example:</h5> 577 * <p class='bjava'> 578 * <ja>@RestDelete</ja>( 579 * path=<js>"/{propertyName}"</js>, 580 * 581 * <jc>// Swagger info.</jc> 582 * swagger={ 583 * <js>"parameters:["</js>, 584 * <js>"{name:'propertyName',in:'path',description:'The system property name.'},"</js>, 585 * <js>"{in:'body',description:'The new system property value.'}"</js>, 586 * <js>"],"</js>, 587 * <js>"responses:{"</js>, 588 * <js>"302: {headers:{Location:{description:'The root URL of this resource.'}}},"</js>, 589 * <js>"403: {description:'User is not an admin.'}"</js>, 590 * <js>"}"</js> 591 * } 592 * ) 593 * </p> 594 * 595 * <h5 class='section'>Notes:</h5><ul> 596 * <li class='note'> 597 * The format is <a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauBeanSwagger2">juneau-bean-swagger-v2</a>. 598 * <br>Multiple lines are concatenated with newlines. 599 * <li class='note'> 600 * The starting and ending <js>'{'</js>/<js>'}'</js> characters around the entire value are optional. 601 * <li class='note'> 602 * These values are superimposed on top of any Swagger JSON file present for the resource in the classpath. 603 * <li class='note'> 604 * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/RestServerSvlVariables">SVL Variables</a> 605 * (e.g. <js>"$L{my.localized.variable}"</js>). 606 * </ul> 607 * 608 * <h5 class='section'>See Also:</h5><ul> 609 * <li class='ja'>{@link OpSwagger} 610 * <li class='jc'>{@link SwaggerProvider} 611 * </ul> 612 * 613 * @return The annotation value. 614 */ 615 OpSwagger swagger() default @OpSwagger; 616 617 /** 618 * REST method path. 619 * 620 * <p> 621 * Can be used to provide a shortened form for the {@link #path()} value. 622 * 623 * <p> 624 * The following examples are considered equivalent. 625 * <p class='bjava'> 626 * <jc>// Normal form</jc> 627 * <ja>@RestDelete</ja>(path=<js>"/{propertyName}"</js>) 628 * 629 * <jc>// Shortened form</jc> 630 * <ja>@RestDelete</ja>(<js>"/{propertyName}"</js>) 631 * </p> 632 * 633 * @return The annotation value. 634 */ 635 String value() default ""; 636}