3232import java .io .FileInputStream ;
3333import java .io .InputStream ;
3434import java .io .FileOutputStream ;
35+ import java .util .List ;
3536
3637import org .apache .commons .io .IOUtils ;
3738
@@ -97,7 +98,6 @@ public Response uploadFile(
9798 @ ApiParam (value = "file to upload" ) @ FormDataParam ("file" ) InputStream inputStream ,
9899 @ ApiParam (value = "file detail" ) @ FormDataParam ("file" ) FormDataContentDisposition fileDetail ) {
99100 LOGGER .debug ("testString: " + testString );
100- System .out .println ("uploading file " + testString );
101101 try {
102102 String uploadedFileLocation = "./" + fileDetail .getFileName ();
103103 System .out .println ("uploading to " + uploadedFileLocation );
@@ -142,7 +142,8 @@ public Response updatePet(
142142 @ ApiResponses (value = { @ ApiResponse (code = 400 , message = "Invalid status value" ) })
143143 public Response findPetsByStatus (
144144 @ ApiParam (value = "Status values that need to be considered for filter" , required = true , defaultValue = "available" , allowableValues = "available,pending,sold" , allowMultiple = true ) @ QueryParam ("status" ) String status ) {
145- return Response .ok (petData .findPetByStatus (status )).build ();
145+ List <Pet > pets = petData .findPetByStatus (status );
146+ return Response .ok (pets .toArray (new Pet [pets .size ()])).build ();
146147 }
147148
148149 @ GET
@@ -155,7 +156,8 @@ public Response findPetsByStatus(
155156 @ Deprecated
156157 public Response findPetsByTags (
157158 @ ApiParam (value = "Tags to filter by" , required = true , allowMultiple = true ) @ QueryParam ("tags" ) String tags ) {
158- return Response .ok (petData .findPetByTags (tags )).build ();
159+ List <Pet > pets = petData .findPetByTags (tags );
160+ return Response .ok (pets .toArray (new Pet [pets .size ()])).build ();
159161 }
160162
161163 @ POST
@@ -173,6 +175,4 @@ public Response updatePetWithForm (
173175 System .out .println (status );
174176 return Response .ok ().entity (new com .wordnik .swagger .sample .model .ApiResponse (200 , "SUCCESS" )).build ();
175177 }
176-
177-
178178}
0 commit comments