提交 bea26413 编写于 作者: S Sam Brannen

Support 'produces' attribute in @[Post|Put|Patch]Mapping

Issue: SPR-13992
上级 78690a24
......@@ -32,9 +32,6 @@ import static org.springframework.web.bind.annotation.RequestMethod.PATCH;
*
* <p>Specifically, {@code @PatchMapping} is a <em>composed annotation</em> that
* acts as a shortcut for {@code @RequestMapping(method = RequestMethod.PATCH)}.
* Furthermore, this annotation does not support the
* {@link RequestMapping#method method} and {@link RequestMapping#produces produces}
* attributes of {@code @RequestMapping}.
*
* @author Sam Brannen
* @since 4.3
......@@ -86,4 +83,10 @@ public @interface PatchMapping {
@AliasFor(annotation = RequestMapping.class)
String[] consumes() default {};
/**
* Alias for {@link RequestMapping#produces}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] produces() default {};
}
......@@ -32,9 +32,6 @@ import static org.springframework.web.bind.annotation.RequestMethod.POST;
*
* <p>Specifically, {@code @PostMapping} is a <em>composed annotation</em> that
* acts as a shortcut for {@code @RequestMapping(method = RequestMethod.POST)}.
* Furthermore, this annotation does not support the
* {@link RequestMapping#method method} and {@link RequestMapping#produces produces}
* attributes of {@code @RequestMapping}.
*
* @author Sam Brannen
* @since 4.3
......@@ -86,4 +83,10 @@ public @interface PostMapping {
@AliasFor(annotation = RequestMapping.class)
String[] consumes() default {};
/**
* Alias for {@link RequestMapping#produces}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] produces() default {};
}
......@@ -32,9 +32,6 @@ import static org.springframework.web.bind.annotation.RequestMethod.PUT;
*
* <p>Specifically, {@code @PutMapping} is a <em>composed annotation</em> that
* acts as a shortcut for {@code @RequestMapping(method = RequestMethod.PUT)}.
* Furthermore, this annotation does not support the
* {@link RequestMapping#method method} and {@link RequestMapping#produces produces}
* attributes of {@code @RequestMapping}.
*
* @author Sam Brannen
* @since 4.3
......@@ -86,4 +83,10 @@ public @interface PutMapping {
@AliasFor(annotation = RequestMapping.class)
String[] consumes() default {};
/**
* Alias for {@link RequestMapping#produces}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] produces() default {};
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册