diff --git a/osgi.enroute.rest.simple.provider/src/osgi/enroute/rest/simple/provider/Function.java b/osgi.enroute.rest.simple.provider/src/osgi/enroute/rest/simple/provider/Function.java index 0c67471..5d04047 100644 --- a/osgi.enroute.rest.simple.provider/src/osgi/enroute/rest/simple/provider/Function.java +++ b/osgi.enroute.rest.simple.provider/src/osgi/enroute/rest/simple/provider/Function.java @@ -122,6 +122,10 @@ public Object convert(Type dest, Object o) throws Exception { hasPayloadAsParameter = false; } + if (path.equals("/") && cardinality > 0) + throw new IllegalArgumentException("Invalid " + verb + + " method " + method.getName() + ". A method on the root path cannot have a non-zero cardinality."); + this.post = requestBody; this.cardinality = cardinality;