Updated Spring, Boot, Fox and Cloud dependencies (#5969)

* updated Spring, Boot, Fox and Cloud dependencies

* run scripts for java, jaxrs-cxf and spring samples (although changes are not related to my changes)

* update jersey java8 petstore samples

* update java feign samples

* update java petstore samples

* add new files for java petstore clients

* roll back spring cloud dep version

* fix jaxrs-cxf error
This commit is contained in:
wing328 2017-07-03 18:44:22 +08:00 committed by GitHub
parent 76481d1d80
commit 25a46374c5
30 changed files with 141 additions and 43 deletions

1
.gitignore vendored
View File

@ -80,6 +80,7 @@ samples/client/petstore/java/default/build/
samples/client/petstore/scala/build/
samples/client/petstore/java/resttemplate/hello.txt
samples/client/petstore/java/retrofit2/hello.txt
samples/client/petstore/java/feign/hello.txt
#PHP
samples/client/petstore/php/SwaggerClient-php/composer.lock

View File

@ -241,7 +241,7 @@
<spring-version>4.3.9.RELEASE</spring-version>
{{/generateSpringApplication}}
{{#generateSpringBootApplication}}
<spring.boot-version>1.4.7.RELEASE</spring.boot-version>
<spring.boot-version>1.5.4.RELEASE</spring.boot-version>
{{/generateSpringBootApplication}}
<cxf-version>3.1.11</cxf-version>
<jackson-jaxrs-version>2.8.9</jackson-jaxrs-version>

View File

@ -9,12 +9,12 @@
<java.version>{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<springfox-version>2.6.1</springfox-version>
<springfox-version>2.7.0</springfox-version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.7.RELEASE</version>
<version>1.5.4.RELEASE</version>
</parent>
<build>
<sourceDirectory>src/main/java</sourceDirectory>

View File

@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.7.RELEASE</version>
<version>1.5.4.RELEASE</version>
</parent>
<build>
<sourceDirectory>src/main/java</sourceDirectory>

View File

@ -159,7 +159,7 @@
<slf4j-version>1.7.21</slf4j-version>
<junit-version>4.12</junit-version>
<servlet-api-version>2.5</servlet-api-version>
<springfox-version>2.6.0</springfox-version>
<springfox-version>2.7.0</springfox-version>
<jackson-version>2.8.9</jackson-version>
<jackson-threetenbp-version>2.6.4</jackson-threetenbp-version>
<spring-version>4.3.9.RELEASE</spring-version>

View File

@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.7.RELEASE</version>
<version>1.5.4.RELEASE</version>
</parent>
<build>
<sourceDirectory>src/main/java</sourceDirectory>

View File

@ -42,9 +42,12 @@
</dependency>
<dependency>
<groupId>com.github.joschi.jackson</groupId>
<artifactId>jackson-datatype-threetenbp</artifactId>
<version>2.6.4</version>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
<!-- Bean Validation API support -->
<dependency>

View File

@ -22,4 +22,4 @@
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
**/impl/*
#**/impl/*

View File

@ -1 +1 @@
2.2.3-SNAPSHOT
2.3.0-SNAPSHOT

View File

@ -78,10 +78,18 @@ public interface FakeApi {
@Path("/fake")
@Consumes({ "*/*" })
@Produces({ "*/*" })
@ApiOperation(value = "To test enum parameters", tags={ "fake" })
@ApiOperation(value = "To test enum parameters", tags={ "fake", })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid request"),
@ApiResponse(code = 404, message = "Not found") })
public void testEnumParameters(@Multipart(value = "enum_form_string_array", required = false) List<String> enumFormStringArray, @Multipart(value = "enum_form_string", required = false) String enumFormString, @HeaderParam("enum_header_string_array") List<String> enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array") List<String> enumQueryStringArray, @QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @Multipart(value = "enum_query_double", required = false) Double enumQueryDouble);
@GET
@Path("/fake/jsonFormData")
@Consumes({ "application/json" })
@ApiOperation(value = "test json serialization of form data", tags={ "fake" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") })
public void testJsonFormData(@Multipart(value = "param") String param, @Multipart(value = "param2") String param2);
}

View File

@ -17,6 +17,7 @@ import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ApiResponse;
import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*;
import javax.validation.Valid;
@Path("/")
@Api(value = "/", description = "")
@ -29,6 +30,6 @@ public interface FakeClassnameTags123Api {
@ApiOperation(value = "To test class name in snake case", tags={ "fake_classname_tags 123#$%^" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
public Client testClassname(Client body);
public Client testClassname(@Valid Client body);
}

View File

@ -179,7 +179,7 @@ public class FormatTest {
* @return _byte
**/
@NotNull
public byte[] getByte() {
@Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public byte[] getByte() {
return _byte;
}

View File

@ -4,9 +4,8 @@ import io.swagger.api.*;
import java.math.BigDecimal;
import io.swagger.model.Client;
import java.util.Date;
import io.swagger.model.OuterComposite;
import org.joda.time.LocalDate;
import io.swagger.model.OuterComposite;
import java.io.InputStream;
import java.io.OutputStream;
@ -22,30 +21,30 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api;
public class FakeApiServiceImpl implements FakeApi {
@Override
public Boolean fakeOuterBooleanSerialize(Boolean body) {
// TODO: Implement...
return null;
}
@Override
public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) {
// TODO: Implement...
return null;
}
@Override
public BigDecimal fakeOuterNumberSerialize(BigDecimal body) {
// TODO: Implement...
return null;
}
@Override
public String fakeOuterStringSerialize(String body) {
// TODO: Implement...
return null;
}
public Client testClientModel(Client body) {
// TODO: Implement...
@ -64,5 +63,11 @@ public class FakeApiServiceImpl implements FakeApi {
}
public void testJsonFormData(String param, String param2) {
// TODO: Implement...
}
}

View File

@ -96,12 +96,23 @@ public class FakeApi {
@Consumes({ "*/*" })
@Produces({ "*/*" })
@ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = void.class, tags={ "fake" })
@ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = void.class, tags={ "fake", })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid request", response = void.class),
@ApiResponse(code = 404, message = "Not found", response = void.class) })
public Response testEnumParameters(@FormParam(value = "enum_form_string_array") List<String> enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString,@HeaderParam("enum_header_string_array") List<String> enumHeaderStringArray,@HeaderParam("enum_header_string") String enumHeaderString,@QueryParam("enum_query_string_array") List<String> enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString,@QueryParam("enum_query_integer") Integer enumQueryInteger,@FormParam(value = "enum_query_double") Double enumQueryDouble) {
return Response.ok().entity("magic!").build();
}
@GET
@Path("/jsonFormData")
@Consumes({ "application/json" })
@ApiOperation(value = "test json serialization of form data", notes = "", response = void.class, tags={ "fake" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = void.class) })
public Response testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2) {
return Response.ok().entity("magic!").build();
}
}

View File

@ -27,7 +27,7 @@ public class FakeClassnameTestApi {
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
public Response testClassname(Client body) {
return Response.ok().entity("magic!").build();
return Response.ok().entity("magic!").build();
}
}

View File

@ -160,7 +160,7 @@ public class FormatTest {
@ApiModelProperty(required = true, value = "")
@NotNull
public byte[] getByte() {
@Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public byte[] getByte() {
return _byte;
}
public void setByte(byte[] _byte) {

View File

@ -998,6 +998,33 @@
}
}
}
},
"/fake/jsonFormData" : {
"get" : {
"tags" : [ "fake" ],
"summary" : "test json serialization of form data",
"description" : "",
"operationId" : "testJsonFormData",
"consumes" : [ "application/json" ],
"parameters" : [ {
"name" : "param",
"in" : "formData",
"description" : "field1",
"required" : true,
"type" : "string"
}, {
"name" : "param2",
"in" : "formData",
"description" : "field2",
"required" : true,
"type" : "string"
} ],
"responses" : {
"200" : {
"description" : "successful operation"
}
}
}
}
},
"securityDefinitions" : {
@ -1337,7 +1364,8 @@
},
"byte" : {
"type" : "string",
"format" : "byte"
"format" : "byte",
"pattern" : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
},
"binary" : {
"type" : "string",

View File

@ -1 +1 @@
2.2.3-SNAPSHOT
2.3.0-SNAPSHOT

View File

@ -166,4 +166,17 @@ public class FakeApi {
throws NotFoundException {
return delegate.testEnumParameters(enumFormStringArray,enumFormString,enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,enumQueryDouble,securityContext);
}
@GET
@Path("/jsonFormData")
@Consumes({ "application/json" })
@io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = void.class, tags={ "fake", })
@io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) })
public Response testJsonFormData(@ApiParam(value = "field1", required=true) @FormParam("param") String param
,@ApiParam(value = "field2", required=true) @FormParam("param2") String param2
,@Context SecurityContext securityContext)
throws NotFoundException {
return delegate.testJsonFormData(param,param2,securityContext);
}
}

View File

@ -27,4 +27,5 @@ public abstract class FakeApiService {
public abstract Response testClientModel(Client body,SecurityContext securityContext) throws NotFoundException;
public abstract Response testEndpointParameters(BigDecimal number,Double _double,String patternWithoutDelimiter,byte[] _byte,Integer integer,Integer int32,Long int64,Float _float,String string,byte[] binary,Date date,Date dateTime,String password,String paramCallback,SecurityContext securityContext) throws NotFoundException;
public abstract Response testEnumParameters(List<String> enumFormStringArray,String enumFormString,List<String> enumHeaderStringArray,String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger,Double enumQueryDouble,SecurityContext securityContext) throws NotFoundException;
public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException;
}

View File

@ -17,6 +17,7 @@ import java.io.InputStream;
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import org.glassfish.jersey.media.multipart.FormDataParam;
import javax.servlet.ServletConfig;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
@ -29,7 +30,28 @@ import javax.validation.constraints.*;
@io.swagger.annotations.Api(description = "the fake_classname_test API")
public class FakeClassnameTestApi {
private final FakeClassnameTestApiService delegate = FakeClassnameTestApiServiceFactory.getFakeClassnameTestApi();
private final FakeClassnameTestApiService delegate;
public FakeClassnameTestApi(@Context ServletConfig servletContext) {
FakeClassnameTestApiService delegate = null;
if (servletContext != null) {
String implClass = servletContext.getInitParameter("FakeClassnameTestApi.implementation");
if (implClass != null && !"".equals(implClass.trim())) {
try {
delegate = (FakeClassnameTestApiService) Class.forName(implClass).newInstance();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
if (delegate == null) {
delegate = FakeClassnameTestApiServiceFactory.getFakeClassnameTestApi();
}
this.delegate = delegate;
}
@PATCH

View File

@ -223,7 +223,7 @@ public class FormatTest {
@JsonProperty("byte")
@ApiModelProperty(required = true, value = "")
@NotNull
public byte[] getByte() {
@Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public byte[] getByte() {
return _byte;
}

View File

@ -55,4 +55,9 @@ public class FakeApiServiceImpl extends FakeApiService {
// do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
}
@Override
public Response testJsonFormData(String param, String param2, SecurityContext securityContext) throws NotFoundException {
// do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
}
}

View File

@ -139,7 +139,7 @@
<slf4j-version>1.7.21</slf4j-version>
<junit-version>4.12</junit-version>
<servlet-api-version>2.5</servlet-api-version>
<springfox-version>2.6.0</springfox-version>
<springfox-version>2.7.0</springfox-version>
<jackson-version>2.8.9</jackson-version>
<jackson-threetenbp-version>2.6.4</jackson-threetenbp-version>
<spring-version>4.3.9.RELEASE</spring-version>

View File

@ -139,7 +139,7 @@
<slf4j-version>1.7.21</slf4j-version>
<junit-version>4.12</junit-version>
<servlet-api-version>2.5</servlet-api-version>
<springfox-version>2.6.0</springfox-version>
<springfox-version>2.7.0</springfox-version>
<jackson-version>2.8.9</jackson-version>
<jackson-threetenbp-version>2.6.4</jackson-threetenbp-version>
<spring-version>4.3.9.RELEASE</spring-version>

View File

@ -9,12 +9,12 @@
<java.version>1.7</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<springfox-version>2.6.1</springfox-version>
<springfox-version>2.7.0</springfox-version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.7.RELEASE</version>
<version>1.5.4.RELEASE</version>
</parent>
<build>
<sourceDirectory>src/main/java</sourceDirectory>

View File

@ -9,12 +9,12 @@
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<springfox-version>2.6.1</springfox-version>
<springfox-version>2.7.0</springfox-version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.7.RELEASE</version>
<version>1.5.4.RELEASE</version>
</parent>
<build>
<sourceDirectory>src/main/java</sourceDirectory>

View File

@ -9,12 +9,12 @@
<java.version>1.7</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<springfox-version>2.6.1</springfox-version>
<springfox-version>2.7.0</springfox-version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.7.RELEASE</version>
<version>1.5.4.RELEASE</version>
</parent>
<build>
<sourceDirectory>src/main/java</sourceDirectory>

View File

@ -9,12 +9,12 @@
<java.version>1.7</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<springfox-version>2.6.1</springfox-version>
<springfox-version>2.7.0</springfox-version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.7.RELEASE</version>
<version>1.5.4.RELEASE</version>
</parent>
<build>
<sourceDirectory>src/main/java</sourceDirectory>

View File

@ -9,12 +9,12 @@
<java.version>1.7</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<springfox-version>2.6.1</springfox-version>
<springfox-version>2.7.0</springfox-version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.7.RELEASE</version>
<version>1.5.4.RELEASE</version>
</parent>
<build>
<sourceDirectory>src/main/java</sourceDirectory>