@ApiError(code = 500, reason = "Unexpected error")})
public Response add(@ApiParam(required = true, allowMultiple = false, allowableValues = "Only number", value = "Car identifier") @FormParam("id") String id, @ApiParam(required = false, allowMultiple = false, allowableValues = "All unless space", value = "Car name") @FormParam("name") String name, @ApiParam(value = "Car constructor name", allowableValues = "opel, ford, audi") @FormParam("constructor") String constructor) {
if (id == null || "".equals(id.trim())) {
return Response.status(Response.Status.BAD_REQUEST).build();
}
Car c = new Car();
c.id = id;
c.name = name;
c.constructor = constructor;
CAR_DB.put(c.id, c);
return Response.ok("Car added", MediaType.TEXT_PLAIN_TYPE).build();