use of io.swagger.models.Sample in project swagger-core by swagger-api.
the class ResourceWithValidation method getTest303.
@GET
@Path("/303")
@ApiOperation(value = "Get", httpMethod = "GET")
public Response getTest303(@ApiParam(value = "sample param data") @QueryParam("id") @NotNull @Min(10) Integer id) throws WebApplicationException {
Sample out = new Sample();
out.setName("foo");
out.setValue("bar");
return Response.ok().entity(out).build();
}
use of io.swagger.models.Sample in project swagger-core by swagger-api.
the class SimpleResource method getTest.
@GET
@Path("/{id}")
@ApiOperation(value = "Get object by ID", notes = "No details provided", response = Sample.class, position = 0)
@ApiResponses({ @ApiResponse(code = 400, message = "Invalid ID", response = NotFoundModel.class), @ApiResponse(code = 404, message = "object not found") })
public Response getTest(@ApiParam(value = "sample param data", required = true, allowableValues = "range[0,10]") @DefaultValue("5") @PathParam("id") String id, @QueryParam("limit") Integer limit) throws WebApplicationException {
Sample out = new Sample();
out.setName("foo");
out.setValue("bar");
return Response.ok().entity(out).build();
}
use of io.swagger.models.Sample in project swagger-core by swagger-api.
the class SimpleResourceWithVendorAnnotation method getTest.
@VendorFunnyAnnotation
@GET
@Path("/{id}")
@ApiOperation(value = "Get object by ID", notes = "No details provided", response = Sample.class, position = 0)
@ApiResponses({ @ApiResponse(code = 400, message = "Invalid ID", response = NotFoundModel.class), @ApiResponse(code = 404, message = "object not found") })
public Response getTest(@ApiParam(value = "sample param data", required = true, allowableValues = "range[0,10]") @DefaultValue("5") @PathParam("id") final String id, @QueryParam("limit") final Integer limit) throws WebApplicationException {
final Sample out = new Sample();
out.setName("foo");
out.setValue("bar");
return Response.ok().entity(out).build();
}
use of io.swagger.models.Sample in project swagger-core by swagger-api.
the class SimpleResourceWithoutAnnotations method getTest.
@GET
@Path("/{id}")
public Sample getTest(@DefaultValue("5") @PathParam("id") String id, @QueryParam("limit") Integer limit) throws WebApplicationException {
Sample out = new Sample();
out.setName("foo");
out.setValue("bar");
return out;
}
Aggregations