diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala index c17f0a12911..bdf489c08c0 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala @@ -123,7 +123,7 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", * @param status Status values that need to be considered for filter * @return List[Pet] */ - def findPetsByStatus (status: List[String]) : Option[List[Pet]] = { + def findPetsByStatus (status: List[String] = available) : Option[List[Pet]] = { // create path and map variables val path = "/pet/findByStatus".replaceAll("\\{format\\}","json") diff --git a/samples/html/index.html b/samples/html/index.html index 4a9212ea440..9d47aa360eb 100644 --- a/samples/html/index.html +++ b/samples/html/index.html @@ -69,7 +69,7 @@
status (optional)
-
Query Parameter — Status values that need to be considered for filter
+
Query Parameter — Status values that need to be considered for filter default: available

Return type

@@ -98,16 +98,8 @@
Content-Type: application/xml
<Pet>
   <id>123456</id>
-  <Category>
-    <id>123456</id>
-    <name>string</name>
-  </Category>
   <name>doggie</name>
   <photoUrls>string</photoUrls>
-  <Tag>
-    <id>123456</id>
-    <name>string</name>
-  </Tag>
   <status>string</status>
 </Pet>
@@ -153,16 +145,8 @@
Content-Type: application/xml
<Pet>
   <id>123456</id>
-  <Category>
-    <id>123456</id>
-    <name>string</name>
-  </Category>
   <name>doggie</name>
   <photoUrls>string</photoUrls>
-  <Tag>
-    <id>123456</id>
-    <name>string</name>
-  </Tag>
   <status>string</status>
 </Pet>
@@ -208,16 +192,8 @@
Content-Type: application/xml
<Pet>
   <id>123456</id>
-  <Category>
-    <id>123456</id>
-    <name>string</name>
-  </Category>
   <name>doggie</name>
   <photoUrls>string</photoUrls>
-  <Tag>
-    <id>123456</id>
-    <name>string</name>
-  </Tag>
   <status>string</status>
 </Pet>
@@ -356,7 +332,7 @@ "complete" : true, "status" : "aeiou", "quantity" : 123, - "shipDate" : "2015-05-21T05:19:00.242+0000" + "shipDate" : "2015-05-21T05:49:06.118+0000" }

Example data

@@ -365,7 +341,7 @@ <id>123456</id> <petId>123456</petId> <quantity>0</quantity> - <shipDate>2015-05-20T22:19:00.244Z</shipDate> + <shipDate>2015-05-20T22:49:06.120Z</shipDate> <status>string</status> <complete>true</complete> </Order> @@ -399,7 +375,7 @@ "complete" : true, "status" : "aeiou", "quantity" : 123, - "shipDate" : "2015-05-21T05:19:00.245+0000" + "shipDate" : "2015-05-21T05:49:06.121+0000" }

Example data

@@ -408,7 +384,7 @@ <id>123456</id> <petId>123456</petId> <quantity>0</quantity> - <shipDate>2015-05-20T22:19:00.246Z</shipDate> + <shipDate>2015-05-20T22:49:06.122Z</shipDate> <status>string</status> <complete>true</complete> </Order> diff --git a/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/PetApi.java index a303cf84bc3..8abaf768136 100644 --- a/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/PetApi.java @@ -70,7 +70,7 @@ public class PetApi { @com.wordnik.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value") }) - public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter") @QueryParam("status") List status) + public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", defaultValue="available") @QueryParam("status") List status) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java index 1484dcc4dea..a39a8e70970 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java @@ -43,6 +43,7 @@ public class PetApi { consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) public ResponseEntity updatePet( + @ApiParam(value = "Pet object that needs to be added to the store" ) Pet body) throws NotFoundException { // do some magic! @@ -59,6 +60,7 @@ public class PetApi { consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) public ResponseEntity addPet( + @ApiParam(value = "Pet object that needs to be added to the store" ) Pet body) throws NotFoundException { // do some magic! @@ -75,7 +77,8 @@ public class PetApi { produces = { "application/json", "application/xml" }, method = RequestMethod.GET) - public ResponseEntity findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter") @RequestParam(value = "status", required = false) List status + public ResponseEntity findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", defaultValue = "available") @RequestParam(value = "status", required = false, defaultValue="available") List status + ) throws NotFoundException { // do some magic! @@ -93,6 +96,7 @@ public class PetApi { method = RequestMethod.GET) public ResponseEntity findPetsByTags(@ApiParam(value = "Tags to filter by") @RequestParam(value = "tags", required = false) List tags + ) throws NotFoundException { // do some magic! @@ -110,7 +114,8 @@ public class PetApi { produces = { "application/json", "application/xml" }, method = RequestMethod.GET) - public ResponseEntity getPetById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("petId") Long petId + public ResponseEntity getPetById( +@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("petId") Long petId ) throws NotFoundException { // do some magic! @@ -126,14 +131,17 @@ public class PetApi { produces = { "application/json", "application/xml" }, consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") String petId + public ResponseEntity updatePetWithForm( +@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") String petId , -@ApiParam(value = "Updated name of the pet" )@RequestPart("name") String name, + +@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, -@ApiParam(value = "Updated status of the pet" )@RequestPart("status") String status) + +@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status) throws NotFoundException { // do some magic! return new ResponseEntity(HttpStatus.OK); @@ -148,9 +156,11 @@ public class PetApi { produces = { "application/json", "application/xml" }, method = RequestMethod.DELETE) - public ResponseEntity deletePet(@ApiParam(value = "" ) @RequestHeader(value="apiKey", required=false) String apiKey + public ResponseEntity deletePet( +@ApiParam(value = "" ) @RequestHeader(value="apiKey", required=false) String apiKey , - @ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId + +@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId ) throws NotFoundException { // do some magic! @@ -166,12 +176,15 @@ public class PetApi { produces = { "application/json", "application/xml" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId + public ResponseEntity uploadFile( +@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId , -@ApiParam(value = "Additional data to pass to server" )@RequestPart("additionalMetadata") String additionalMetadata, + +@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, + @ApiParam(value = "file detail") @RequestPart("file") MultipartFile fileDetail) throws NotFoundException { // do some magic! diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java index 5951036403d..ba6e233ce9c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java @@ -57,6 +57,7 @@ public class StoreApi { method = RequestMethod.POST) public ResponseEntity placeOrder( + @ApiParam(value = "order placed for purchasing the pet" ) Order body) throws NotFoundException { // do some magic! @@ -74,7 +75,8 @@ public class StoreApi { produces = { "application/json", "application/xml" }, method = RequestMethod.GET) - public ResponseEntity getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") String orderId + public ResponseEntity getOrderById( +@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") String orderId ) throws NotFoundException { // do some magic! @@ -91,7 +93,8 @@ public class StoreApi { produces = { "application/json", "application/xml" }, method = RequestMethod.DELETE) - public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId + public ResponseEntity deleteOrder( +@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId ) throws NotFoundException { // do some magic! diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java index a978aad2d5e..15b170e90a7 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java @@ -41,6 +41,7 @@ public class UserApi { method = RequestMethod.POST) public ResponseEntity createUser( + @ApiParam(value = "Created user object" ) User body) throws NotFoundException { // do some magic! @@ -57,6 +58,7 @@ public class UserApi { method = RequestMethod.POST) public ResponseEntity createUsersWithArrayInput( + @ApiParam(value = "List of user object" ) List body) throws NotFoundException { // do some magic! @@ -73,6 +75,7 @@ public class UserApi { method = RequestMethod.POST) public ResponseEntity createUsersWithListInput( + @ApiParam(value = "List of user object" ) List body) throws NotFoundException { // do some magic! @@ -90,8 +93,10 @@ public class UserApi { method = RequestMethod.GET) public ResponseEntity loginUser(@ApiParam(value = "The user name for login") @RequestParam(value = "username", required = false) String username + , @ApiParam(value = "The password for login in clear text") @RequestParam(value = "password", required = false) String password + ) throws NotFoundException { // do some magic! @@ -124,7 +129,8 @@ public class UserApi { produces = { "application/json", "application/xml" }, method = RequestMethod.GET) - public ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username + public ResponseEntity getUserByName( +@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username ) throws NotFoundException { // do some magic! @@ -141,9 +147,11 @@ public class UserApi { produces = { "application/json", "application/xml" }, method = RequestMethod.PUT) - public ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username + public ResponseEntity updateUser( +@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username , + @ApiParam(value = "Updated user object" ) User body) throws NotFoundException { // do some magic! @@ -160,7 +168,8 @@ public class UserApi { produces = { "application/json", "application/xml" }, method = RequestMethod.DELETE) - public ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username + public ResponseEntity deleteUser( +@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username ) throws NotFoundException { // do some magic!