Skip to content

Commit

Permalink
Fix sh script for 'jaxrs-cxf-client' and generate sample
Browse files Browse the repository at this point in the history
  • Loading branch information
jmini committed Mar 21, 2018
1 parent 3b031ed commit 1b2d918
Showing 19 changed files with 82 additions and 301 deletions.
2 changes: 1 addition & 1 deletion bin/jaxrs-cxf-client-petstore.sh
Original file line number Diff line number Diff line change
@@ -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/swagger-codegen/src/main/resources/JavaJaxRS/cxf/ -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-cxf -o samples/client/petstore/jaxrs-cxf-client/"
ags="$@ generate --artifact-id "jaxrs-cxf-petstore-client" -t modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/ -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-cxf-client -o samples/client/petstore/jaxrs-cxf-client/"

java $JAVA_OPTS -jar $executable $ags
Original file line number Diff line number Diff line change
@@ -21,5 +21,3 @@
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

**/impl/*
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.1-SNAPSHOT
2.4.0-SNAPSHOT
34 changes: 5 additions & 29 deletions samples/client/petstore/jaxrs-cxf-client/pom.xml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger</groupId>
<artifactId>jaxrs-cxf-petstore-client</artifactId>
<packaging>war</packaging>
<packaging>jar</packaging>
<name>jaxrs-cxf-petstore-client</name>
<description>This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key &#x60;special-key&#x60; to test the authorization filters.</description>
<version>1.0.0</version>
@@ -33,7 +33,7 @@
<stopPort>8079</stopPort>
<stopKey>stopit</stopKey>
<httpConnector>
<port>8080</port>
<port></port>
<idleTimeout>60000</idleTimeout>
</httpConnector>
</configuration>
@@ -77,15 +77,6 @@
</execution>
</executions>
</plugin>

<!-- build WAR file -->
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
@@ -113,13 +104,6 @@
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
<!-- Bean Validation API support -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${beanvalidation-version}</version>
<scope>provided</scope>
</dependency>
<!-- CXF Client -->
<dependency>
<groupId>org.apache.cxf</groupId>
@@ -141,12 +125,6 @@
<version>${cxf-version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-service-description-swagger</artifactId>
<version>${cxf-version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-ws-policy</artifactId>
@@ -166,10 +144,9 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>${jackson-jaxrs-version}</version>
<scope>compile</scope>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>${jackson-jaxrs-version}</version>
</dependency>
</dependencies>
<repositories>
@@ -190,7 +167,6 @@
<junit-version>4.12</junit-version>
<logback-version>1.1.7</logback-version>
<servlet-api-version>2.5</servlet-api-version>
<beanvalidation-version>1.1.0.Final</beanvalidation-version>
<cxf-version>3.2.1</cxf-version>
<jackson-jaxrs-version>2.9.1</jackson-jaxrs-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Original file line number Diff line number Diff line change
@@ -18,8 +18,6 @@
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ApiResponse;
import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*;
import javax.validation.Valid;

/**
* Swagger Petstore
@@ -41,10 +39,10 @@ public interface PetApi {
@Path("/pet")
@Consumes({ "application/json", "application/xml" })
@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={ })
@ApiResponses(value = {
@ApiResponse(code = 405, message = "Invalid input") })
public void addPet(@Valid Pet body);
@ApiResponse(code = 405, message = "Invalid input", response = .class) })
public void addPet(Pet body);

/**
* Deletes a pet
@@ -55,9 +53,9 @@ public interface PetApi {
@DELETE
@Path("/pet/{petId}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Deletes a pet", tags={ "pet", })
@ApiOperation(value = "Deletes a pet", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid pet value") })
@ApiResponse(code = 400, message = "Invalid pet value", response = .class) })
public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey);

/**
@@ -69,11 +67,11 @@ public interface PetApi {
@GET
@Path("/pet/findByStatus")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Finds Pets by status", tags={ "pet", })
@ApiOperation(value = "Finds Pets by status", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid status value") })
public List<Pet> findPetsByStatus(@QueryParam("status") @NotNull List<String> status);
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "array"),
@ApiResponse(code = 400, message = "Invalid status value", response = .class) })
public List<Pet> findPetsByStatus(@QueryParam("status")List<String> status);

/**
* Finds Pets by tags
@@ -84,11 +82,11 @@ public interface PetApi {
@GET
@Path("/pet/findByTags")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Finds Pets by tags", tags={ "pet", })
@ApiOperation(value = "Finds Pets by tags", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid tag value") })
public List<Pet> findPetsByTags(@QueryParam("tags") @NotNull List<String> tags);
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "array"),
@ApiResponse(code = 400, message = "Invalid tag value", response = .class) })
public List<Pet> findPetsByTags(@QueryParam("tags")List<String> tags);

/**
* Find pet by ID
@@ -99,11 +97,11 @@ public interface PetApi {
@GET
@Path("/pet/{petId}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Find pet by ID", tags={ "pet", })
@ApiOperation(value = "Find pet by ID", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
@ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Pet not found") })
@ApiResponse(code = 400, message = "Invalid ID supplied", response = .class),
@ApiResponse(code = 404, message = "Pet not found", response = .class) })
public Pet getPetById(@PathParam("petId") Long petId);

/**
@@ -116,12 +114,12 @@ public interface PetApi {
@Path("/pet")
@Consumes({ "application/json", "application/xml" })
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Update an existing pet", tags={ "pet", })
@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(@Valid Pet body);
@ApiResponse(code = 400, message = "Invalid ID supplied", response = .class),
@ApiResponse(code = 404, message = "Pet not found", response = .class),
@ApiResponse(code = 405, message = "Validation exception", response = .class) })
public void updatePet(Pet body);

/**
* Updates a pet in the store with form data
@@ -133,9 +131,9 @@ public interface PetApi {
@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={ "pet", })
@ApiOperation(value = "Updates a pet in the store with form data", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 405, message = "Invalid input") })
@ApiResponse(code = 405, message = "Invalid input", response = .class) })
public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status);

/**
@@ -148,7 +146,7 @@ public interface PetApi {
@Path("/pet/{petId}/uploadImage")
@Consumes({ "multipart/form-data" })
@Produces({ "application/json" })
@ApiOperation(value = "uploads an image", tags={ "pet" })
@ApiOperation(value = "uploads an image", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail);
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.swagger.api;

import java.util.Map;
import io.swagger.model.Order;

import java.io.InputStream;
@@ -17,8 +16,6 @@
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ApiResponse;
import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*;
import javax.validation.Valid;

/**
* Swagger Petstore
@@ -39,10 +36,10 @@ public interface StoreApi {
@DELETE
@Path("/store/order/{orderId}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Delete purchase order by ID", tags={ "store", })
@ApiOperation(value = "Delete purchase order by ID", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Order not found") })
@ApiResponse(code = 400, message = "Invalid ID supplied", response = .class),
@ApiResponse(code = 404, message = "Order not found", response = .class) })
public void deleteOrder(@PathParam("orderId") String orderId);

/**
@@ -54,9 +51,9 @@ public interface StoreApi {
@GET
@Path("/store/inventory")
@Produces({ "application/json" })
@ApiOperation(value = "Returns pet inventories by status", tags={ "store", })
@ApiOperation(value = "Returns pet inventories by status", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") })
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "map") })
public Map<String, Integer> getInventory();

/**
@@ -68,12 +65,12 @@ public interface StoreApi {
@GET
@Path("/store/order/{orderId}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Find purchase order by ID", tags={ "store", })
@ApiOperation(value = "Find purchase order by ID", tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Order not found") })
public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId);
@ApiResponse(code = 400, message = "Invalid ID supplied", response = .class),
@ApiResponse(code = 404, message = "Order not found", response = .class) })
public Order getOrderById(@PathParam("orderId") Long orderId);

/**
* Place an order for a pet
@@ -84,10 +81,10 @@ public interface StoreApi {
@POST
@Path("/store/order")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Place an order for a pet", tags={ "store" })
@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(@Valid Order body);
@ApiResponse(code = 400, message = "Invalid Order", response = .class) })
public Order placeOrder(Order body);
}

Loading

0 comments on commit 1b2d918

Please # to comment.