forked from loafle/openapi-generator-original
Add support for modifier within the Jaxb XMLElement annotation (#4433)
* fixes #4432 Adding support for the modifier within the Jaxb XMLElement annotation. Updated README with JaxbAnnotations configuration option. * #4432 Running the Petstore files
This commit is contained in:
parent
a846a571b3
commit
0a559f0dd2
@ -45,7 +45,8 @@ mvn clean compile
|
|||||||
- `modelPackage` - the package to use for generated model objects/classes
|
- `modelPackage` - the package to use for generated model objects/classes
|
||||||
- `apiPackage` - the package to use for generated api objects/classes
|
- `apiPackage` - the package to use for generated api objects/classes
|
||||||
- `invokerPackage` - the package to use for the generated invoker objects
|
- `invokerPackage` - the package to use for the generated invoker objects
|
||||||
- `modelNamePrefix` and `modelNameSuffix` - Sets the pre- or suffix for model classes and enums.
|
- `modelNamePrefix` and `modelNameSuffix` - Sets the pre- or suffix for model classes and enums
|
||||||
|
- `useJaxbAnnotations` - enable Jaxb annotations inside the generated models
|
||||||
- `configOptions` - a map of language-specific parameters (see below)
|
- `configOptions` - a map of language-specific parameters (see below)
|
||||||
- `configHelp` - dumps the configuration help for the specified library (generates no sources)
|
- `configHelp` - dumps the configuration help for the specified library (generates no sources)
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {
|
|||||||
|
|
||||||
{{>enumClass}}{{/items}}{{/items.isEnum}}
|
{{>enumClass}}{{/items}}{{/items.isEnum}}
|
||||||
{{#useJaxbAnnotations}}
|
{{#useJaxbAnnotations}}
|
||||||
@XmlElement(name="{{baseName}}")
|
@XmlElement(name="{{baseName}}"{{#required}}, required = {{required}}{{/required}})
|
||||||
{{/useJaxbAnnotations}}
|
{{/useJaxbAnnotations}}
|
||||||
@ApiModelProperty({{#example}}example = "{{example}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}")
|
@ApiModelProperty({{#example}}example = "{{example}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}")
|
||||||
private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/vars}}
|
private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/vars}}
|
||||||
|
|
||||||
|
@ -15,6 +15,14 @@
|
|||||||
<maven>2.2.0</maven>
|
<maven>2.2.0</maven>
|
||||||
</prerequisites>
|
</prerequisites>
|
||||||
|
|
||||||
|
<licenses>
|
||||||
|
<license>
|
||||||
|
<name>Unlicense</name>
|
||||||
|
<url>http://www.apache.org/licenses/LICENSE-2.0.html *_/ ' \" =end -- \\r\\n \\n \\r</url>
|
||||||
|
<distribution>repo</distribution>
|
||||||
|
</license>
|
||||||
|
</licenses>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -129,7 +137,6 @@
|
|||||||
<artifactId>joda-time</artifactId>
|
<artifactId>joda-time</artifactId>
|
||||||
<version>${jodatime-version}</version>
|
<version>${jodatime-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- test dependencies -->
|
<!-- test dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
@ -150,4 +157,4 @@
|
|||||||
<junit-version>4.12</junit-version>
|
<junit-version>4.12</junit-version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
</project>
|
</project>
|
||||||
|
@ -9,146 +9,159 @@
|
|||||||
* https://github.com/swagger-api/swagger-codegen.git
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package io.swagger.client.api;
|
package io.swagger.client.api;
|
||||||
|
|
||||||
import io.swagger.client.ApiCallback;
|
import io.swagger.client.ApiCallback;
|
||||||
import io.swagger.client.ApiClient;
|
import io.swagger.client.ApiClient;
|
||||||
import io.swagger.client.ApiException;
|
import io.swagger.client.ApiException;
|
||||||
import io.swagger.client.ApiResponse;
|
import io.swagger.client.ApiResponse;
|
||||||
import io.swagger.client.Configuration;
|
import io.swagger.client.Configuration;
|
||||||
import io.swagger.client.Pair;
|
import io.swagger.client.Pair;
|
||||||
import io.swagger.client.ProgressRequestBody;
|
import io.swagger.client.ProgressRequestBody;
|
||||||
import io.swagger.client.ProgressResponseBody;
|
import io.swagger.client.ProgressResponseBody;
|
||||||
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
|
||||||
import java.util.ArrayList;
|
import java.lang.reflect.Type;
|
||||||
import java.util.HashMap;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
public class FakeApi {
|
|
||||||
private ApiClient apiClient;
|
public class FakeApi {
|
||||||
|
private ApiClient apiClient;
|
||||||
public FakeApi() {
|
|
||||||
this(Configuration.getDefaultApiClient());
|
public FakeApi() {
|
||||||
}
|
this(Configuration.getDefaultApiClient());
|
||||||
|
}
|
||||||
public FakeApi(ApiClient apiClient) {
|
|
||||||
this.apiClient = apiClient;
|
public FakeApi(ApiClient apiClient) {
|
||||||
}
|
this.apiClient = apiClient;
|
||||||
|
}
|
||||||
public ApiClient getApiClient() {
|
|
||||||
return apiClient;
|
public ApiClient getApiClient() {
|
||||||
}
|
return apiClient;
|
||||||
|
}
|
||||||
public void setApiClient(ApiClient apiClient) {
|
|
||||||
this.apiClient = apiClient;
|
public void setApiClient(ApiClient apiClient) {
|
||||||
}
|
this.apiClient = apiClient;
|
||||||
|
}
|
||||||
/* Build call for testCodeInjectEndRnNR */
|
|
||||||
private com.squareup.okhttp.Call testCodeInjectEndRnNRCall(String testCodeInjectEndRnNR, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
/* Build call for testCodeInjectEndRnNR */
|
||||||
Object localVarPostBody = null;
|
private com.squareup.okhttp.Call testCodeInjectEndRnNRCall(String testCodeInjectEndRnNR, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
|
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
|
||||||
|
|
||||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||||
|
|
||||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||||
|
|
||||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||||
if (testCodeInjectEndRnNR != null)
|
if (testCodeInjectEndRnNR != null)
|
||||||
localVarFormParams.put("test code inject */ ' " =end -- \r\n \n \r", testCodeInjectEndRnNR);
|
localVarFormParams.put("test code inject */ ' " =end -- \r\n \n \r", testCodeInjectEndRnNR);
|
||||||
|
|
||||||
final String[] localVarAccepts = {
|
final String[] localVarAccepts = {
|
||||||
"application/json", "*_/ ' =end -- "
|
"application/json", "*_/ ' =end -- "
|
||||||
};
|
};
|
||||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||||
|
|
||||||
final String[] localVarContentTypes = {
|
final String[] localVarContentTypes = {
|
||||||
"application/json", "*_/ ' =end -- "
|
"application/json", "*_/ ' =end -- "
|
||||||
};
|
};
|
||||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||||
|
|
||||||
if(progressListener != null) {
|
if(progressListener != null) {
|
||||||
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
||||||
@Override
|
@Override
|
||||||
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
||||||
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
||||||
return originalResponse.newBuilder()
|
return originalResponse.newBuilder()
|
||||||
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] localVarAuthNames = new String[] { };
|
String[] localVarAuthNames = new String[] { };
|
||||||
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@SuppressWarnings("rawtypes")
|
||||||
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
private com.squareup.okhttp.Call testCodeInjectEndRnNRValidateBeforeCall(String testCodeInjectEndRnNR, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||||
*
|
|
||||||
* @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional)
|
|
||||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
com.squareup.okhttp.Call call = testCodeInjectEndRnNRCall(testCodeInjectEndRnNR, progressListener, progressRequestListener);
|
||||||
*/
|
return call;
|
||||||
public void testCodeInjectEndRnNR(String testCodeInjectEndRnNR) throws ApiException {
|
|
||||||
testCodeInjectEndRnNRWithHttpInfo(testCodeInjectEndRnNR);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
}
|
||||||
*
|
|
||||||
* @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional)
|
/**
|
||||||
* @return ApiResponse<Void>
|
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
*
|
||||||
*/
|
* @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional)
|
||||||
public ApiResponse<Void> testCodeInjectEndRnNRWithHttpInfo(String testCodeInjectEndRnNR) throws ApiException {
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||||
com.squareup.okhttp.Call call = testCodeInjectEndRnNRCall(testCodeInjectEndRnNR, null, null);
|
*/
|
||||||
return apiClient.execute(call);
|
public void testCodeInjectEndRnNR(String testCodeInjectEndRnNR) throws ApiException {
|
||||||
}
|
testCodeInjectEndRnNRWithHttpInfo(testCodeInjectEndRnNR);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (asynchronously)
|
/**
|
||||||
*
|
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||||
* @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional)
|
*
|
||||||
* @param callback The callback to be executed when the API call finishes
|
* @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional)
|
||||||
* @return The request call
|
* @return ApiResponse<Void>
|
||||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||||
*/
|
*/
|
||||||
public com.squareup.okhttp.Call testCodeInjectEndRnNRAsync(String testCodeInjectEndRnNR, final ApiCallback<Void> callback) throws ApiException {
|
public ApiResponse<Void> testCodeInjectEndRnNRWithHttpInfo(String testCodeInjectEndRnNR) throws ApiException {
|
||||||
|
com.squareup.okhttp.Call call = testCodeInjectEndRnNRValidateBeforeCall(testCodeInjectEndRnNR, null, null);
|
||||||
ProgressResponseBody.ProgressListener progressListener = null;
|
return apiClient.execute(call);
|
||||||
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
}
|
||||||
|
|
||||||
if (callback != null) {
|
/**
|
||||||
progressListener = new ProgressResponseBody.ProgressListener() {
|
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (asynchronously)
|
||||||
@Override
|
*
|
||||||
public void update(long bytesRead, long contentLength, boolean done) {
|
* @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional)
|
||||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
* @param callback The callback to be executed when the API call finishes
|
||||||
}
|
* @return The request call
|
||||||
};
|
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||||
|
*/
|
||||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
public com.squareup.okhttp.Call testCodeInjectEndRnNRAsync(String testCodeInjectEndRnNR, final ApiCallback<Void> callback) throws ApiException {
|
||||||
@Override
|
|
||||||
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
ProgressResponseBody.ProgressListener progressListener = null;
|
||||||
callback.onUploadProgress(bytesWritten, contentLength, done);
|
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
||||||
}
|
|
||||||
};
|
if (callback != null) {
|
||||||
}
|
progressListener = new ProgressResponseBody.ProgressListener() {
|
||||||
|
@Override
|
||||||
com.squareup.okhttp.Call call = testCodeInjectEndRnNRCall(testCodeInjectEndRnNR, progressListener, progressRequestListener);
|
public void update(long bytesRead, long contentLength, boolean done) {
|
||||||
apiClient.executeAsync(call, callback);
|
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||||
return call;
|
}
|
||||||
}
|
};
|
||||||
}
|
|
||||||
|
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||||
|
@Override
|
||||||
|
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
||||||
|
callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
com.squareup.okhttp.Call call = testCodeInjectEndRnNRValidateBeforeCall(testCodeInjectEndRnNR, progressListener, progressRequestListener);
|
||||||
|
apiClient.executeAsync(call, callback);
|
||||||
|
return call;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,75 +1,75 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import io.swagger.model.ModelApiResponse;
|
import io.swagger.model.ModelApiResponse;
|
||||||
import io.swagger.model.Pet;
|
import io.swagger.model.Pet;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.ws.rs.*;
|
import javax.ws.rs.*;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import org.apache.cxf.jaxrs.ext.multipart.*;
|
import org.apache.cxf.jaxrs.ext.multipart.*;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
@Path("/")
|
@Path("/")
|
||||||
@Api(value = "/", description = "")
|
@Api(value = "/", description = "")
|
||||||
public interface PetApi {
|
public interface PetApi {
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("/pet")
|
@Path("/pet")
|
||||||
@Consumes({ "application/json", "application/xml" })
|
@Consumes({ "application/json", "application/xml" })
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Add a new pet to the store", tags={ "pet", })
|
@ApiOperation(value = "Add a new pet to the store", tags={ "pet", })
|
||||||
public void addPet(Pet body);
|
public void addPet(Pet body);
|
||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("/pet/{petId}")
|
@Path("/pet/{petId}")
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Deletes a pet", tags={ "pet", })
|
@ApiOperation(value = "Deletes a pet", tags={ "pet", })
|
||||||
public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey);
|
public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey);
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/pet/findByStatus")
|
@Path("/pet/findByStatus")
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Finds Pets by status", tags={ "pet", })
|
@ApiOperation(value = "Finds Pets by status", tags={ "pet", })
|
||||||
public List<Pet> findPetsByStatus(@QueryParam("status")List<String> status);
|
public List<Pet> findPetsByStatus(@QueryParam("status")List<String> status);
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/pet/findByTags")
|
@Path("/pet/findByTags")
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Finds Pets by tags", tags={ "pet", })
|
@ApiOperation(value = "Finds Pets by tags", tags={ "pet", })
|
||||||
public List<Pet> findPetsByTags(@QueryParam("tags")List<String> tags);
|
public List<Pet> findPetsByTags(@QueryParam("tags")List<String> tags);
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/pet/{petId}")
|
@Path("/pet/{petId}")
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Find pet by ID", tags={ "pet", })
|
@ApiOperation(value = "Find pet by ID", tags={ "pet", })
|
||||||
public Pet getPetById(@PathParam("petId") Long petId);
|
public Pet getPetById(@PathParam("petId") Long petId);
|
||||||
|
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/pet")
|
@Path("/pet")
|
||||||
@Consumes({ "application/json", "application/xml" })
|
@Consumes({ "application/json", "application/xml" })
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Update an existing pet", tags={ "pet", })
|
@ApiOperation(value = "Update an existing pet", tags={ "pet", })
|
||||||
public void updatePet(Pet body);
|
public void updatePet(Pet body);
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("/pet/{petId}")
|
@Path("/pet/{petId}")
|
||||||
@Consumes({ "application/x-www-form-urlencoded" })
|
@Consumes({ "application/x-www-form-urlencoded" })
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Updates a pet in the store with form data", tags={ "pet", })
|
@ApiOperation(value = "Updates a pet in the store with form data", tags={ "pet", })
|
||||||
public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status);
|
public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status);
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("/pet/{petId}/uploadImage")
|
@Path("/pet/{petId}/uploadImage")
|
||||||
@Consumes({ "multipart/form-data" })
|
@Consumes({ "multipart/form-data" })
|
||||||
@Produces({ "application/json" })
|
@Produces({ "application/json" })
|
||||||
@ApiOperation(value = "uploads an image", tags={ "pet" })
|
@ApiOperation(value = "uploads an image", tags={ "pet" })
|
||||||
public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail);
|
public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,46 +1,46 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import io.swagger.model.Order;
|
import io.swagger.model.Order;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.ws.rs.*;
|
import javax.ws.rs.*;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import org.apache.cxf.jaxrs.ext.multipart.*;
|
import org.apache.cxf.jaxrs.ext.multipart.*;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
@Path("/")
|
@Path("/")
|
||||||
@Api(value = "/", description = "")
|
@Api(value = "/", description = "")
|
||||||
public interface StoreApi {
|
public interface StoreApi {
|
||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("/store/order/{orderId}")
|
@Path("/store/order/{orderId}")
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Delete purchase order by ID", tags={ "store", })
|
@ApiOperation(value = "Delete purchase order by ID", tags={ "store", })
|
||||||
public void deleteOrder(@PathParam("orderId") String orderId);
|
public void deleteOrder(@PathParam("orderId") String orderId);
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/store/inventory")
|
@Path("/store/inventory")
|
||||||
@Produces({ "application/json" })
|
@Produces({ "application/json" })
|
||||||
@ApiOperation(value = "Returns pet inventories by status", tags={ "store", })
|
@ApiOperation(value = "Returns pet inventories by status", tags={ "store", })
|
||||||
public Map<String, Integer> getInventory();
|
public Map<String, Integer> getInventory();
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/store/order/{orderId}")
|
@Path("/store/order/{orderId}")
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Find purchase order by ID", tags={ "store", })
|
@ApiOperation(value = "Find purchase order by ID", tags={ "store", })
|
||||||
public Order getOrderById(@PathParam("orderId") Long orderId);
|
public Order getOrderById(@PathParam("orderId") Long orderId);
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("/store/order")
|
@Path("/store/order")
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Place an order for a pet", tags={ "store" })
|
@ApiOperation(value = "Place an order for a pet", tags={ "store" })
|
||||||
public Order placeOrder(Order body);
|
public Order placeOrder(Order body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,70 +1,70 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import io.swagger.model.User;
|
import io.swagger.model.User;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.ws.rs.*;
|
import javax.ws.rs.*;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import org.apache.cxf.jaxrs.ext.multipart.*;
|
import org.apache.cxf.jaxrs.ext.multipart.*;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
@Path("/")
|
@Path("/")
|
||||||
@Api(value = "/", description = "")
|
@Api(value = "/", description = "")
|
||||||
public interface UserApi {
|
public interface UserApi {
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("/user")
|
@Path("/user")
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Create user", tags={ "user", })
|
@ApiOperation(value = "Create user", tags={ "user", })
|
||||||
public void createUser(User body);
|
public void createUser(User body);
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("/user/createWithArray")
|
@Path("/user/createWithArray")
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Creates list of users with given input array", tags={ "user", })
|
@ApiOperation(value = "Creates list of users with given input array", tags={ "user", })
|
||||||
public void createUsersWithArrayInput(List<User> body);
|
public void createUsersWithArrayInput(List<User> body);
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("/user/createWithList")
|
@Path("/user/createWithList")
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Creates list of users with given input array", tags={ "user", })
|
@ApiOperation(value = "Creates list of users with given input array", tags={ "user", })
|
||||||
public void createUsersWithListInput(List<User> body);
|
public void createUsersWithListInput(List<User> body);
|
||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("/user/{username}")
|
@Path("/user/{username}")
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Delete user", tags={ "user", })
|
@ApiOperation(value = "Delete user", tags={ "user", })
|
||||||
public void deleteUser(@PathParam("username") String username);
|
public void deleteUser(@PathParam("username") String username);
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/user/{username}")
|
@Path("/user/{username}")
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Get user by user name", tags={ "user", })
|
@ApiOperation(value = "Get user by user name", tags={ "user", })
|
||||||
public User getUserByName(@PathParam("username") String username);
|
public User getUserByName(@PathParam("username") String username);
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/user/login")
|
@Path("/user/login")
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Logs user into the system", tags={ "user", })
|
@ApiOperation(value = "Logs user into the system", tags={ "user", })
|
||||||
public String loginUser(@QueryParam("username")String username, @QueryParam("password")String password);
|
public String loginUser(@QueryParam("username")String username, @QueryParam("password")String password);
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/user/logout")
|
@Path("/user/logout")
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Logs out current logged in user session", tags={ "user", })
|
@ApiOperation(value = "Logs out current logged in user session", tags={ "user", })
|
||||||
public void logoutUser();
|
public void logoutUser();
|
||||||
|
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/user/{username}")
|
@Path("/user/{username}")
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@ApiOperation(value = "Updated user", tags={ "user" })
|
@ApiOperation(value = "Updated user", tags={ "user" })
|
||||||
public void updateUser(@PathParam("username") String username, User body);
|
public void updateUser(@PathParam("username") String username, User body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user