Skip to content

Commit

Permalink
Simple response to feature request osgi#68, enable primary rest endpo…
Browse files Browse the repository at this point in the history
…int.

If a method is named for the verb with no path given, provide from the
root of the endpoint.

Signed-off-by: Elias N Vasylenko <[email protected]>
  • Loading branch information
Sophos-Elias-Vasylenko committed Mar 24, 2017
1 parent b22569a commit 0218e57
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0218e57

Please sign in to comment.