-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1882 from scottrw93/master
Fix for Jaxrs file upload missing param in service class
- Loading branch information
Showing
28 changed files
with
218 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
modules/swagger-codegen/src/main/resources/JavaJaxRS/jersey1_18/serviceFormParams.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{{#isFormParam}}{{#notFile}}{{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}FormDataContentDisposition fileDetail{{/isFile}}{{/isFormParam}} | ||
{{#isFormParam}}{{#notFile}}{{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}InputStream inputStream, FormDataContentDisposition fileDetail{{/isFile}}{{/isFormParam}} |
2 changes: 1 addition & 1 deletion
2
samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/ApiException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/NotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/PettestingByteArraytrueApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package io.swagger.api; | ||
|
||
import io.swagger.model.*; | ||
import io.swagger.api.PettestingByteArraytrueApiService; | ||
import io.swagger.api.factories.PettestingByteArraytrueApiServiceFactory; | ||
|
||
import io.swagger.annotations.ApiParam; | ||
|
||
import com.sun.jersey.multipart.FormDataParam; | ||
|
||
|
||
import java.util.List; | ||
import io.swagger.api.NotFoundException; | ||
|
||
import java.io.InputStream; | ||
|
||
import com.sun.jersey.core.header.FormDataContentDisposition; | ||
import com.sun.jersey.multipart.FormDataParam; | ||
|
||
import javax.ws.rs.core.Context; | ||
import javax.ws.rs.core.Response; | ||
import javax.ws.rs.core.SecurityContext; | ||
import javax.ws.rs.*; | ||
|
||
@Path("/pet?testing_byte_array=true") | ||
|
||
|
||
@io.swagger.annotations.Api(description = "the pet?testing_byte_array=true API") | ||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2016-01-14T21:37:36.074Z") | ||
public class PettestingByteArraytrueApi { | ||
private final PettestingByteArraytrueApiService delegate = PettestingByteArraytrueApiServiceFactory.getPettestingByteArraytrueApi(); | ||
|
||
@POST | ||
|
||
@Consumes({ "application/json", "application/xml" }) | ||
@Produces({ "application/json", "application/xml" }) | ||
@io.swagger.annotations.ApiOperation(value = "Fake endpoint to test byte array in body parameter for adding a new pet to the store", notes = "", response = Void.class, authorizations = { | ||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { | ||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), | ||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") | ||
}) | ||
}, tags={ "pet" }) | ||
@io.swagger.annotations.ApiResponses(value = { | ||
@io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) | ||
|
||
public Response addPetUsingByteArray(@ApiParam(value = "Pet object in the form of byte array" ) byte[] body,@Context SecurityContext securityContext) | ||
throws NotFoundException { | ||
return delegate.addPetUsingByteArray(body,securityContext); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
.../server/petstore/jaxrs/src/gen/java/io/swagger/api/PettestingByteArraytrueApiService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.swagger.api; | ||
|
||
import io.swagger.api.*; | ||
import io.swagger.model.*; | ||
|
||
import com.sun.jersey.multipart.FormDataParam; | ||
|
||
|
||
import java.util.List; | ||
import io.swagger.api.NotFoundException; | ||
|
||
import java.io.InputStream; | ||
|
||
import com.sun.jersey.core.header.FormDataContentDisposition; | ||
import com.sun.jersey.multipart.FormDataParam; | ||
|
||
import javax.ws.rs.core.Response; | ||
import javax.ws.rs.core.SecurityContext; | ||
|
||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2016-01-14T21:37:36.074Z") | ||
public abstract class PettestingByteArraytrueApiService { | ||
|
||
public abstract Response addPetUsingByteArray(byte[] body,SecurityContext securityContext) | ||
throws NotFoundException; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
samples/server/petstore/jaxrs/src/gen/java/io/swagger/api/StringUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package io.swagger.api; | ||
|
||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2016-01-14T21:37:36.074Z") | ||
public class StringUtil { | ||
/** | ||
* Check if the given array contains the given value (with case-insensitive comparison). | ||
* | ||
* @param array The array | ||
* @param value The value to search | ||
* @return true if the array contains the value | ||
*/ | ||
public static boolean containsIgnoreCase(String[] array, String value) { | ||
for (String str : array) { | ||
if (value == null && str == null) return true; | ||
if (value != null && value.equalsIgnoreCase(str)) return true; | ||
} | ||
return false; | ||
} | ||
|
||
/** | ||
* Join an array of strings with the given separator. | ||
* <p> | ||
* Note: This might be replaced by utility method from commons-lang or guava someday | ||
* if one of those libraries is added as dependency. | ||
* </p> | ||
* | ||
* @param array The array of strings | ||
* @param separator The separator | ||
* @return the resulting string | ||
*/ | ||
public static String join(String[] array, String separator) { | ||
int len = array.length; | ||
if (len == 0) return ""; | ||
|
||
StringBuilder out = new StringBuilder(); | ||
out.append(array[0]); | ||
for (int i = 1; i < len; i++) { | ||
out.append(separator).append(array[i]); | ||
} | ||
return out.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...axrs/src/main/java/io/swagger/api/factories/PettestingByteArraytrueApiServiceFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package io.swagger.api.factories; | ||
|
||
import io.swagger.api.PettestingByteArraytrueApiService; | ||
import io.swagger.api.impl.PettestingByteArraytrueApiServiceImpl; | ||
|
||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2016-01-14T21:37:36.074Z") | ||
public class PettestingByteArraytrueApiServiceFactory { | ||
|
||
private final static PettestingByteArraytrueApiService service = new PettestingByteArraytrueApiServiceImpl(); | ||
|
||
public static PettestingByteArraytrueApiService getPettestingByteArraytrueApi() | ||
{ | ||
return service; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.