Search in sources :

Example 6 with Sample

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();
}
Also used : Sample(io.swagger.models.Sample) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation)

Example 7 with Sample

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();
}
Also used : Sample(io.swagger.models.Sample) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Example 8 with Sample

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();
}
Also used : Sample(io.swagger.models.Sample) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Example 9 with Sample

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;
}
Also used : Sample(io.swagger.models.Sample) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Aggregations

Sample (io.swagger.models.Sample)9 GET (javax.ws.rs.GET)9 Path (javax.ws.rs.Path)9 ApiOperation (io.swagger.annotations.ApiOperation)8 ApiResponses (io.swagger.annotations.ApiResponses)5