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
4 changes: 2 additions & 2 deletions 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" -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
java $JAVA_OPTS -jar $executable $ags
2 changes: 1 addition & 1 deletion bin/windows/jaxrs-cxf-client-petstore.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ If Not Exist %executable% (
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
set ags=generate --artifact-id "jaxrs-cxf-client-petstore-client" -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l jaxrs-cxf-client -o samples\client\petstore\jaxrs-cxf-client

REM java %JAVA_OPTS% -jar %executable% %ags%
java %JAVA_OPTS% -jar %executable% %ags%
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
import io.swagger.codegen.languages.features.LoggingTestFeatures;
import io.swagger.codegen.languages.features.UseGenericResponseFeatures;

/**
* new version of this class can be found on: https://github.com/swagger-api/swagger-codegen-generators
* @deprecated use <code>io.swagger.codegen.languages.java.JavaCXFClientCodegen</code> instead.
*/
@Deprecated
public class JavaCXFClientCodegen extends AbstractJavaCodegen
implements BeanValidationFeatures, UseGenericResponseFeatures, GzipTestFeatures, LoggingTestFeatures {

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
3.0.0-SNAPSHOT
49 changes: 17 additions & 32 deletions samples/client/petstore/jaxrs-cxf-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
<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>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
Expand Down Expand Up @@ -33,10 +35,11 @@
<stopPort>8079</stopPort>
<stopKey>stopit</stopKey>
<httpConnector>
<port>8080</port>
<port></port>
<idleTimeout>60000</idleTimeout>
</httpConnector>
</configuration>

<executions>
<execution>
<id>start-jetty</id>
Expand Down Expand Up @@ -77,15 +80,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 +107,7 @@
<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 +129,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 @@ -165,12 +147,15 @@
<version>${jackson-jaxrs-version}</version>
<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>
<repository>
Expand All @@ -185,14 +170,14 @@
<java.version>1.7</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>1.5.15</swagger-core-version>
<swagger-core-version>1.5.18</swagger-core-version>
<jetty-version>9.2.9.v20150224</jetty-version>
<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.1.11</cxf-version>
<jackson-jaxrs-version>2.8.9</jackson-jaxrs-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>
</properties>
</project>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package io.swagger.api;

import java.io.File;
import io.swagger.model.ModelApiResponse;
import io.swagger.model.Pet;


import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
Expand All @@ -18,139 +18,191 @@
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
*

* <p>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 `special-key` to test the authorization filters.
*

*/

@Path("/")
@Api(value = "/", description = "")

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={ "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 pet);



/**
* Deletes a pet
*
*
*

*/

@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);
public void deletePet(@PathParam("petId") Integer petId, @HeaderParam("api_key") String apiKey);



/**
* Finds Pets by status
*

* Multiple status values can be provided with comma separated strings
*

*/

@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
*

* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
*

*/

@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
*

* Returns a single pet
*

*/

@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") })
public Pet getPetById(@PathParam("petId") Long petId);
public Pet getPetById(@PathParam("petId") Integer petId);



/**
* Update an existing pet
*
*
*

*/

@PUT
@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 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={ "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);
public void updatePetWithForm(@PathParam("petId") Integer petId, Object body);



/**
* uploads an image
*
*
*

*/

@POST
@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);
public ModelApiResponse uploadFile(@PathParam("petId") Integer petId, Object body);

}


Loading