Permalink
Browse files

Fixed typo with multi-value response annotation

  • Loading branch information...
2 parents e0eb67b + 03d9a1c commit 705f23b9fdc649349c9daf70735fd1ef77d5fa71 @rpidikiti rpidikiti committed Aug 31, 2011
View
@@ -78,7 +78,7 @@
<target name="server.start" description="starts the server with stop port enabled">
<delete quiet="true" file="dist/logs/wordnik.log" />
- <java jar="dist/start.jar" fork="true" spawn="true" dir="dist">
+ <java jar="dist/start.jar" fork="true" dir="dist">
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8585,server=y,suspend=n" />
<sysproperty key="START" value="conf/start.config" />
<sysproperty key="STOP.PORT" value="8079" />
View
@@ -130,7 +130,7 @@
<!-- extra options -->
<!-- =========================================================== -->
<Set name="stopAtShutdown">true</Set>
- <Set name="sendServerVersion">true</Set>
+ <Set name="sendServerVersion">false</Set>
<Set name="sendDateHeader">true</Set>
<Set name="gracefulShutdown">1000</Set>
</Configure>
@@ -30,19 +30,20 @@ import com.sun.jersey.spi.resource.Singleton
import javax.ws.rs.core.Response
import javax.ws.rs._
import java.lang.Exception
+import com.sun.jersey.api.JResponse
trait PetResource extends RestResourceUtil {
var petData = new PetData
@GET
@Path("/{petId}")
- @ApiOperation(value = "Find Pet by id", notes = "Returns a pet when id < 10. " +
- "Id > 10 or non integers will simulate API error conditions", responseClass = "com.wordnik.swagger.sample.model.Pet")
+ @ApiOperation(value = "Find pet by ID", notes = "Returns a pet when ID < 10. " +
+ "ID > 10 or nonintegers will simulate API error conditions", responseClass = "com.wordnik.swagger.sample.model.Pet")
@ApiErrors(Array(
new ApiError(code = 400, reason = "Invalid ID supplied"),
new ApiError(code = 404, reason = "Pet not found")))
def getPetById(
- @ApiParam(value = "ID of pet that need to be fetched", required = true)@PathParam("petId") petId: String) = {
+ @ApiParam(value = "ID of pet that needs to be fetched", required = true)@PathParam("petId") petId: String) = {
var pet = petData.getPetbyId(getLong(0, 100000, 0, petId))
if (null != pet) {
Response.ok.entity(pet).build
@@ -52,7 +53,7 @@ trait PetResource extends RestResourceUtil {
}
@POST
- @ApiOperation(value = "Add a new Pet to the store")
+ @ApiOperation(value = "Add a new pet to the store")
@ApiErrors(Array(
new ApiError(code = 405, reason = "Invalid input")))
def addPet(
@@ -62,7 +63,7 @@ trait PetResource extends RestResourceUtil {
}
@PUT
- @ApiOperation(value = "Update an existing Pet")
+ @ApiOperation(value = "Update an existing pet")
@ApiErrors(Array(
new ApiError(code = 400, reason = "Invalid ID supplied"),
new ApiError(code = 404, reason = "Pet not found"),
@@ -81,10 +82,10 @@ trait PetResource extends RestResourceUtil {
@ApiErrors(Array(
new ApiError(code = 400, reason = "Invalid status value")))
def findPetsByStatus(
- @ApiParam(value = "Status values that needs to be considered for filter", required = true, defaultValue = "available",
+ @ApiParam(value = "Status values that need to be considered for filter", required = true, defaultValue = "available",
allowableValues = "available,pending,sold", allowMultiple = true)@QueryParam("status") status: String) = {
var results = petData.findPetByStatus(status)
- Response.ok.entity(results).build
+ JResponse.ok(results).build
}
@GET
@@ -99,19 +100,19 @@ trait PetResource extends RestResourceUtil {
@ApiParam(value = "Tags to filter by", required = true,
allowMultiple = true)@QueryParam("tags") tags: String) = {
var results = petData.findPetByTags(tags)
- Response.ok.entity(results).build
+ JResponse.ok(results).build
}
}
@Path("/pet.json")
-@Api(value = "/pet", description = "Operations about Pets")
+@Api(value = "/pet", description = "Operations about pets")
@Singleton
@Produces(Array("application/json"))
class PetResourceJSON extends Help
with PetResource
@Path("/pet.xml")
-@Api(value = "/pet", description = "Operations about Pets")
+@Api(value = "/pet", description = "Operations about pets")
@Singleton
@Produces(Array("application/xml"))
class PetResourceXML extends Help
@@ -32,13 +32,13 @@ trait PetStoreResource extends RestResourceUtil {
@GET
@Path("/order/{orderId}")
- @ApiOperation(value = "Find purchase order by id", notes = "For valid response try integer ids with value <= 5. " +
- "Any thing above 5 or non integers will generate API erros", responseClass = "com.wordnik.swagger.sample.model.Order")
+ @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5. " +
+ "Anything above 5 or nonintegers will generate API errors", responseClass = "com.wordnik.swagger.sample.model.Order")
@ApiErrors(Array(
new ApiError(code = 400, reason = "Invalid ID supplied"),
new ApiError(code = 404, reason = "Order not found")))
def getOrderById(
- @ApiParam(value="ID of pet that need to be fetched",required=true)@PathParam("orderId") orderId: String) = {
+ @ApiParam(value="ID of pet that needs to be fetched",required=true)@PathParam("orderId") orderId: String) = {
var order = storeData.findOrderById(getLong(0,10000, 0, orderId))
if (null != order){
Response.ok.entity(order).build
@@ -49,7 +49,7 @@ trait PetStoreResource extends RestResourceUtil {
@POST
@Path("/order")
- @ApiOperation(value = "Place an order for pet", responseClass = "com.wordnik.swagger.sample.model.Order")
+ @ApiOperation(value = "Place an order for a pet", responseClass = "com.wordnik.swagger.sample.model.Order")
@ApiErrors(Array(
new ApiError(code = 400, reason = "Invalid order")))
def placeOrder(
@@ -60,13 +60,13 @@ trait PetStoreResource extends RestResourceUtil {
@DELETE
@Path("/order/{orderId}")
- @ApiOperation(value = "Delete purchase order by id", notes = "For valid response try integer ids with value < 1000. " +
- "Any thing above 1000 or non integers will generate API erros")
+ @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. " +
+ "Anything above 1000 or nonintegers will generate API errors")
@ApiErrors(Array(
new ApiError(code = 400, reason = "Invalid ID supplied"),
new ApiError(code = 404, reason = "Order not found")))
def deleteOrder(
- @ApiParam(value="ID of the order that need to be deleted",required=true)@PathParam("orderId") orderId: String) = {
+ @ApiParam(value="ID of the order that needs to be deleted",required=true)@PathParam("orderId") orderId: String) = {
storeData.deleteOrder(getLong(0, 10000, 0, orderId))
Response.ok.entity("").build
}
@@ -39,7 +39,7 @@ trait UserResource extends RestResourceUtil {
var userData = new UserData
@POST
- @ApiOperation(value = "Create user", notes = "This can only be done the logged in user")
+ @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.")
def createUser(
@ApiParam(value = "Created user object", required = true) user: User) = {
userData.addUser(user)
@@ -48,7 +48,7 @@ trait UserResource extends RestResourceUtil {
@PUT
@Path("/{username}")
- @ApiOperation(value = "Updated user", notes = "This can only be done the logged in user")
+ @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.")
@ApiErrors(Array(
new ApiError(code = 400, reason = "Invalid username supplied"),
new ApiError(code = 404, reason = "User not found")))
@@ -61,12 +61,12 @@ trait UserResource extends RestResourceUtil {
@DELETE
@Path("/{username}")
- @ApiOperation(value = "Delete user", notes = "This can only be done the logged in user")
+ @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.")
@ApiErrors(Array(
new ApiError(code = 400, reason = "Invalid username supplied"),
new ApiError(code = 404, reason = "User not found")))
def deleteUser(
- @ApiParam(value = "name that need to be deleted", required = true)@PathParam("username") username: String) = {
+ @ApiParam(value = "The name that needs to be deleted", required = true)@PathParam("username") username: String) = {
userData.removeUser(username)
Response.ok.entity("").build
}
@@ -78,7 +78,7 @@ trait UserResource extends RestResourceUtil {
new ApiError(code = 400, reason = "Invalid username supplied"),
new ApiError(code = 404, reason = "User not found")))
def getUserByName(
- @ApiParam(value = "name that need to be fetched. Use user1 for testing. ", required = true)@PathParam("username") username: String) = {
+ @ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ", required = true)@PathParam("username") username: String) = {
var user = userData.findUserByName(username)
if (null != user) {
Response.ok.entity(user).build
@@ -89,12 +89,12 @@ trait UserResource extends RestResourceUtil {
@GET
@Path("/login")
- @ApiOperation(value = "Login user into the system", responseClass = "String")
+ @ApiOperation(value = "Logs user into the system", responseClass = "String")
@ApiErrors(Array(
new ApiError(code = 400, reason = "Invalid username and password combination")))
def loginUser(
- @ApiParam(value = "user name for login", required = true)@QueryParam("username") username: String,
- @ApiParam(value = "password for login in clear text", required = true)@QueryParam("password") password: String) = {
+ @ApiParam(value = "The user name for login", required = true)@QueryParam("username") username: String,
+ @ApiParam(value = "The password for login in clear text", required = true)@QueryParam("password") password: String) = {
Response.ok.entity("logged in user session:" + System.currentTimeMillis()).build
}

0 comments on commit 705f23b

Please sign in to comment.