forked from loafle/openapi-generator-original
Update "jaxrs-cxf-client" sample OAS2, OAS3 (#172)
This commit is contained in:
@@ -26,6 +26,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ generate --artifact-id "jaxrs-cxf-petstore-client" -t modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/ -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l jaxrs-cxf-client -o samples/client/petstore/jaxrs-cxf-client/"
|
||||
ags="$@ generate --artifact-id "jaxrs-cxf-petstore-client" -t modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/ -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l jaxrs-cxf-client -o samples/client/petstore/jaxrs-cxf-client"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=`ls -ld "$SCRIPT"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=`dirname "$SCRIPT"`/..
|
||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||
fi
|
||||
|
||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ generate --artifact-id "jaxrs-cxf-petstore-client" -t modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/ -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l jaxrs-cxf-client -o samples/client/petstore/jaxrs-cxf-client"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -1 +1 @@
|
||||
2.4.0-SNAPSHOT
|
||||
3.0.0-SNAPSHOT
|
||||
@@ -32,27 +32,21 @@ public interface PetApi {
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@POST
|
||||
@Path("/pet")
|
||||
@Consumes({ "application/json", "application/xml" })
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Add a new pet to the store", tags={ })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 405, message = "Invalid input") })
|
||||
public void addPet(Pet body);
|
||||
public void addPet(Pet pet);
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@DELETE
|
||||
@Path("/pet/{petId}")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Deletes a pet", tags={ })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid pet value") })
|
||||
@@ -107,30 +101,24 @@ public interface PetApi {
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@PUT
|
||||
@Path("/pet")
|
||||
@Consumes({ "application/json", "application/xml" })
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Update an existing pet", tags={ })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Pet not found"),
|
||||
@ApiResponse(code = 405, message = "Validation exception") })
|
||||
public void updatePet(Pet body);
|
||||
public void updatePet(Pet pet);
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@POST
|
||||
@Path("/pet/{petId}")
|
||||
@Consumes({ "application/x-www-form-urlencoded" })
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Updates a pet in the store with form data", tags={ })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 405, message = "Invalid input") })
|
||||
@@ -139,8 +127,6 @@ public interface PetApi {
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@POST
|
||||
@Path("/pet/{petId}/uploadImage")
|
||||
|
||||
@@ -35,7 +35,6 @@ public interface StoreApi {
|
||||
*/
|
||||
@DELETE
|
||||
@Path("/store/order/{orderId}")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Delete purchase order by ID", tags={ })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@@ -75,16 +74,15 @@ public interface StoreApi {
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@POST
|
||||
@Path("/store/order")
|
||||
@Consumes({ "application/json" })
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Place an order for a pet", tags={ })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
@ApiResponse(code = 400, message = "Invalid Order") })
|
||||
public Order placeOrder(Order body);
|
||||
public Order placeOrder(Order order);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,39 +35,35 @@ public interface UserApi {
|
||||
*/
|
||||
@POST
|
||||
@Path("/user")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@Consumes({ "application/json" })
|
||||
@ApiOperation(value = "Create user", tags={ })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") })
|
||||
public void createUser(User body);
|
||||
public void createUser(User user);
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@POST
|
||||
@Path("/user/createWithArray")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@Consumes({ "application/json" })
|
||||
@ApiOperation(value = "Creates list of users with given input array", tags={ })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") })
|
||||
public void createUsersWithArrayInput(List<User> body);
|
||||
public void createUsersWithArrayInput(List<User> user);
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@POST
|
||||
@Path("/user/createWithList")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@Consumes({ "application/json" })
|
||||
@ApiOperation(value = "Creates list of users with given input array", tags={ })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") })
|
||||
public void createUsersWithListInput(List<User> body);
|
||||
public void createUsersWithListInput(List<User> user);
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
@@ -77,7 +73,6 @@ public interface UserApi {
|
||||
*/
|
||||
@DELETE
|
||||
@Path("/user/{username}")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Delete user", tags={ })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied"),
|
||||
@@ -87,8 +82,6 @@ public interface UserApi {
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@GET
|
||||
@Path("/user/{username}")
|
||||
@@ -103,8 +96,6 @@ public interface UserApi {
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@GET
|
||||
@Path("/user/login")
|
||||
@@ -118,12 +109,9 @@ public interface UserApi {
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@GET
|
||||
@Path("/user/logout")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Logs out current logged in user session", tags={ })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") })
|
||||
@@ -137,11 +125,11 @@ public interface UserApi {
|
||||
*/
|
||||
@PUT
|
||||
@Path("/user/{username}")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@Consumes({ "application/json" })
|
||||
@ApiOperation(value = "Updated user", tags={ })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid user supplied"),
|
||||
@ApiResponse(code = 404, message = "User not found") })
|
||||
public void updateUser(@PathParam("username") String username, User body);
|
||||
public void updateUser(@PathParam("username") String username, User user);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ public enum StatusEnum {
|
||||
|
||||
@ApiModelProperty(value = "Order Status")
|
||||
/**
|
||||
* Order Status
|
||||
* Order Status
|
||||
**/
|
||||
private StatusEnum status = null;
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public enum StatusEnum {
|
||||
|
||||
@ApiModelProperty(value = "pet status in the store")
|
||||
/**
|
||||
* pet status in the store
|
||||
* pet status in the store
|
||||
**/
|
||||
private StatusEnum status = null;
|
||||
/**
|
||||
|
||||
@@ -41,7 +41,7 @@ public class User {
|
||||
|
||||
@ApiModelProperty(value = "User Status")
|
||||
/**
|
||||
* User Status
|
||||
* User Status
|
||||
**/
|
||||
private Integer userStatus = null;
|
||||
/**
|
||||
|
||||
+4
-14
@@ -76,15 +76,13 @@ public class PetApiTest {
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void addPetTest() {
|
||||
Pet body = null;
|
||||
//api.addPet(body);
|
||||
Pet pet = null;
|
||||
//api.addPet(pet);
|
||||
|
||||
// TODO: test validations
|
||||
|
||||
@@ -94,8 +92,6 @@ public class PetApiTest {
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@@ -167,15 +163,13 @@ public class PetApiTest {
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void updatePetTest() {
|
||||
Pet body = null;
|
||||
//api.updatePet(body);
|
||||
Pet pet = null;
|
||||
//api.updatePet(pet);
|
||||
|
||||
// TODO: test validations
|
||||
|
||||
@@ -185,8 +179,6 @@ public class PetApiTest {
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@@ -205,8 +197,6 @@ public class PetApiTest {
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
|
||||
+2
-4
@@ -127,15 +127,13 @@ public class StoreApiTest {
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void placeOrderTest() {
|
||||
Order body = null;
|
||||
//Order response = api.placeOrder(body);
|
||||
Order order = null;
|
||||
//Order response = api.placeOrder(order);
|
||||
//assertNotNull(response);
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
+8
-18
@@ -81,8 +81,8 @@ public class UserApiTest {
|
||||
*/
|
||||
@Test
|
||||
public void createUserTest() {
|
||||
User body = null;
|
||||
//api.createUser(body);
|
||||
User user = null;
|
||||
//api.createUser(user);
|
||||
|
||||
// TODO: test validations
|
||||
|
||||
@@ -92,15 +92,13 @@ public class UserApiTest {
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void createUsersWithArrayInputTest() {
|
||||
List<User> body = null;
|
||||
//api.createUsersWithArrayInput(body);
|
||||
List<User> user = null;
|
||||
//api.createUsersWithArrayInput(user);
|
||||
|
||||
// TODO: test validations
|
||||
|
||||
@@ -110,15 +108,13 @@ public class UserApiTest {
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void createUsersWithListInputTest() {
|
||||
List<User> body = null;
|
||||
//api.createUsersWithListInput(body);
|
||||
List<User> user = null;
|
||||
//api.createUsersWithListInput(user);
|
||||
|
||||
// TODO: test validations
|
||||
|
||||
@@ -146,8 +142,6 @@ public class UserApiTest {
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@@ -164,8 +158,6 @@ public class UserApiTest {
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@@ -183,8 +175,6 @@ public class UserApiTest {
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@@ -208,8 +198,8 @@ public class UserApiTest {
|
||||
@Test
|
||||
public void updateUserTest() {
|
||||
String username = null;
|
||||
User body = null;
|
||||
//api.updateUser(username, body);
|
||||
User user = null;
|
||||
//api.updateUser(username, user);
|
||||
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
Reference in New Issue
Block a user