Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Simple response to feature request #68, enable primary rest endpoint.
Browse files Browse the repository at this point in the history
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.