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