Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot find symbol @Apierrors #254

Closed
tyler8691 opened this issue Jul 11, 2013 · 3 comments
Closed

cannot find symbol @Apierrors #254

tyler8691 opened this issue Jul 11, 2013 · 3 comments

Comments

@tyler8691
Copy link

I added an errors section to my test class and I got symbol not found for @Apierrors on compile:

@ApiErrors(value = @ApiError(code = 400, reason = "Invalid ID supplied"))

Here's the full class:

package com.tyler.testing;

import com.wordnik.swagger.annotations.*;
import com.wordnik.swagger.jaxrs.*;

import javax.ws.rs.*;

@Path("/test.json")
@Api(value = "/test", description = "Test operations")
@Produces({"application/json"})
public class Test {

  @GET
  @Path("/{id}")
  @ApiOperation(value = "Return a given ID", notes = "Returns an ID when it is less than 10" + "ID > 10 or nonintegers will simulate API error conditions")
    @ApiErrors(value = @ApiError(code = 400, reason = "Invalid ID supplied"))
  public String returnId (
    @ApiParam(value = "ID that you want to be returned to you", allowableValues = "range[1,5]", required = true) @PathParam("id") String id)
    {
    // your resource logic 
    return id;
  }
}

I'm hitting the 1.3.0-RC1 version of Swagger.

@tyler8691
Copy link
Author

I noticed that in branch 1.3.0-RC1 there is no APIErrors annotation. Is this intentional?

@4lejandrito
Copy link

It has changed to @ApiResponses and @ApiResponse

@tyler8691
Copy link
Author

Thanks, you can close this issue.

@fehguy fehguy closed this as completed Jul 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants