Add consumes attribute to @GetMapping

Issue: SPR-14988
This commit is contained in:
bedrin
2016-12-08 01:29:48 +03:00
committed by Rossen Stoyanchev
parent 1b0e95d7d8
commit 8315a4033f
3 changed files with 34 additions and 6 deletions

View File

@@ -31,9 +31,6 @@ import org.springframework.core.annotation.AliasFor;
* <p>Specifically, {@code @GetMapping} is a <em>composed annotation</em> that
* acts as a shortcut for {@code @RequestMapping(method = RequestMethod.GET)}.
*
* <h5>Difference between {@code @GetMapping} &amp; {@code @RequestMapping}</h5>
* <p>{@code @GetMapping} does not support the {@link RequestMapping#consumes consumes}
* attribute of {@code @RequestMapping}.
*
* @author Sam Brannen
* @since 4.3
@@ -79,6 +76,13 @@ public @interface GetMapping {
@AliasFor(annotation = RequestMapping.class)
String[] headers() default {};
/**
* Alias for {@link RequestMapping#consumes}.
* @since 4.3.5
*/
@AliasFor(annotation = RequestMapping.class)
String[] consumes() default {};
/**
* Alias for {@link RequestMapping#produces}.
*/