Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/jaxrs-cxf-client-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -134,6 +134,10 @@ public void preprocessSwagger(Swagger swagger) {

@Override
public Map<String, Object> postProcessOperations(Map<String, Object> objs) {
return jaxrsPostProcessOperations(objs);
}

static Map<String, Object> jaxrsPostProcessOperations(Map<String, Object> objs) {
@SuppressWarnings("unchecked")
Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
if ( operations != null ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,22 +137,7 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert
@SuppressWarnings("unchecked")
public Map<String, Object> postProcessOperations(Map<String, Object> objs) {
objs = super.postProcessOperations(objs);

Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
if (operations != null) {
List<CodegenOperation> ops = (List<CodegenOperation>) operations.get("operation");
for (CodegenOperation operation : ops) {

if (operation.returnType == null) {
operation.returnType = "void";
// set vendorExtensions.x-java-is-response-void to true as
// returnType is set to "void"
operation.vendorExtensions.put("x-java-is-response-void", true);
}
}
}

return operations;
return AbstractJavaJAXRSServerCodegen.jaxrsPostProcessOperations(objs);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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>
Expand Down Expand Up @@ -33,7 +33,7 @@
<stopPort>8079</stopPort>
<stopKey>stopit</stopKey>
<httpConnector>
<port>8080</port>
<port></port>
<idleTimeout>60000</idleTimeout>
</httpConnector>
</configuration>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
public void addPet(Pet body);

/**
* Deletes a pet
Expand All @@ -55,7 +53,7 @@ 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") })
public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey);
Expand All @@ -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);
public List<Pet> findPetsByStatus(@QueryParam("status")List<String> status);

/**
* Finds Pets by tags
Expand All @@ -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);
public List<Pet> findPetsByTags(@QueryParam("tags")List<String> tags);

/**
* Find pet by ID
Expand All @@ -99,7 +97,7 @@ 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"),
Expand All @@ -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);
public void updatePet(Pet body);

/**
* Updates a pet in the store with form data
Expand All @@ -133,7 +131,7 @@ 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") })
public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status);
Expand All @@ -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);
Expand Down
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;
Expand All @@ -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
Expand All @@ -39,7 +36,7 @@ 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") })
Expand All @@ -54,7 +51,7 @@ 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") })
public Map<String, Integer> getInventory();
Expand All @@ -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);
public Order getOrderById(@PathParam("orderId") Long orderId);

/**
* Place an order for a pet
Expand All @@ -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);
public Order placeOrder(Order body);
}

Loading