Commit 06398da4 by Tomasz Juchniewicz Committed by Spencer Gibb

Allow multiple values in @RequestMapping(produces|consumes) for Spring MVC endpoints. (#2523)

Fixes gh-808.
parent 3d7892c2
...@@ -249,7 +249,6 @@ public class SpringMvcContract extends Contract.BaseContract ...@@ -249,7 +249,6 @@ public class SpringMvcContract extends Contract.BaseContract
private void parseProduces(MethodMetadata md, Method method, private void parseProduces(MethodMetadata md, Method method,
RequestMapping annotation) { RequestMapping annotation) {
checkAtMostOne(method, annotation.produces(), "produces");
String[] serverProduces = annotation.produces(); String[] serverProduces = annotation.produces();
String clientAccepts = serverProduces.length == 0 ? null String clientAccepts = serverProduces.length == 0 ? null
: emptyToNull(serverProduces[0]); : emptyToNull(serverProduces[0]);
...@@ -260,7 +259,6 @@ public class SpringMvcContract extends Contract.BaseContract ...@@ -260,7 +259,6 @@ public class SpringMvcContract extends Contract.BaseContract
private void parseConsumes(MethodMetadata md, Method method, private void parseConsumes(MethodMetadata md, Method method,
RequestMapping annotation) { RequestMapping annotation) {
checkAtMostOne(method, annotation.consumes(), "consumes");
String[] serverConsumes = annotation.consumes(); String[] serverConsumes = annotation.consumes();
String clientProduces = serverConsumes.length == 0 ? null String clientProduces = serverConsumes.length == 0 ? null
: emptyToNull(serverConsumes[0]); : emptyToNull(serverConsumes[0]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment