0

I have two different cloud endpoint methods with two different name signatures

@ApiMethod(name = "getWhiteCats", httpMethod = HttpMethod.POST)
 public CollectionResponse<Cat> getWhiteCats(CatCall request)

And

@ApiMethod(name = "getGrayCats", httpMethod = HttpMethod.POST)
public CollectionResponse<Cat> getGrayCats(CatCall request)

But Eclipse is giving the exception

Description Resource Location Path Type There was a problem generating the API metadata for your Cloud Endpoints classes: com.google.api.server.spi.config.validation.DuplicateRestPathException: Multiple methods with same rest path "POST collectionresponse_cat":"getWhiteCats" and "getGrayCats"

Any thoughts on how I might resolve this issue?

rsutormin
  • 1,629
  • 2
  • 17
  • 21
Katedral Pillon
  • 14,534
  • 25
  • 99
  • 199

2 Answers2

0

I solved this issue by passing one more parameter in the @apiMethod annotation for example in your case

@ApiMethod(name = "getWhiteCats", path="Somepath_realted_to_your_service", httpMethod = HttpMethod.POST)

Manish Patiyal
  • 4,427
  • 5
  • 21
  • 35
0

You need to specify a path for your methods with path = "yourPathHere". It should look something like this:

@ApiMethod(name = "getWhiteCats", path = "getWhiteCats", httpMethod = HttpMethod.POST)
 public CollectionResponse getWhiteCats(CatCall request)

and

@ApiMethod(name = "getGrayCats", path = "getGrayCats", httpMethod = HttpMethod.POST)
public CollectionResponse getGrayCats(CatCall request)

The path doesn't have to be the name of your @ApiMethod but I highly recommend it.