You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2015/01/16 03:18:19 UTC
[1/2] cxf git commit: CXF-6046: Enhance SwaggerFeature to support
JAX-RS annotations. Added more examples into demo.
Repository: cxf
Updated Branches:
refs/heads/master a2e1e40d3 -> 7d3944d6e
CXF-6046: Enhance SwaggerFeature to support JAX-RS annotations. Added more examples into demo.
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8fd8c552
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8fd8c552
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8fd8c552
Branch: refs/heads/master
Commit: 8fd8c552f4c2a980a5138de19a2b74104776a4ba
Parents: 85ebf3f
Author: reta <dr...@gmail.com>
Authored: Thu Jan 15 21:15:07 2015 -0500
Committer: reta <dr...@gmail.com>
Committed: Thu Jan 15 21:16:01 2015 -0500
----------------------------------------------------------------------
.../java/demo/jaxrs/swagger/server/Sample.java | 36 ++++++++++++++++++++
1 file changed, 36 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/8fd8c552/distribution/src/main/release/samples/jax_rs/description_swagger/src/main/java/demo/jaxrs/swagger/server/Sample.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/description_swagger/src/main/java/demo/jaxrs/swagger/server/Sample.java b/distribution/src/main/release/samples/jax_rs/description_swagger/src/main/java/demo/jaxrs/swagger/server/Sample.java
index ca92e7c..545d804 100644
--- a/distribution/src/main/release/samples/jax_rs/description_swagger/src/main/java/demo/jaxrs/swagger/server/Sample.java
+++ b/distribution/src/main/release/samples/jax_rs/description_swagger/src/main/java/demo/jaxrs/swagger/server/Sample.java
@@ -21,16 +21,22 @@ package demo.jaxrs.swagger.server;
import java.util.Arrays;
+import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
+import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiImplicitParam;
@@ -73,6 +79,36 @@ public class Sample {
return new Item("name", "Value in " + language);
}
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @POST
+ @ApiOperation(
+ value = "Post operation with entity in a body",
+ notes = "Post operation with entity in a body",
+ response = Item.class
+ )
+ public Response createItem(
+ @Context final UriInfo uriInfo,
+ @ApiParam(value = "item", required = true) final Item item) {
+
+ return Response
+ .created(uriInfo.getBaseUriBuilder().path(item.getName()).build())
+ .entity(item).build();
+ }
+
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Path("/{name}")
+ @PUT
+ @ApiOperation(
+ value = "Put operation with form parameter",
+ notes = "Put operation with form parameter",
+ response = Item.class
+ )
+ public Item updateItem(
+ @ApiParam(value = "name", required = true) @PathParam("name") String name,
+ @ApiParam(value = "value", required = true) @FormParam("value") String value) {
+ return new Item(name, value);
+ }
+
@Path("/{name}")
@DELETE
@ApiOperation(
[2/2] cxf git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/cxf
Posted by re...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cxf
Conflicts:
distribution/src/main/release/samples/jax_rs/description_swagger/src/main/java/demo/jaxrs/swagger/server/Sample.java
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/7d3944d6
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/7d3944d6
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/7d3944d6
Branch: refs/heads/master
Commit: 7d3944d6ecc09f01271658bb876c02e7b51e6f58
Parents: 8fd8c55 a2e1e40
Author: reta <dr...@gmail.com>
Authored: Thu Jan 15 21:18:04 2015 -0500
Committer: reta <dr...@gmail.com>
Committed: Thu Jan 15 21:18:04 2015 -0500
----------------------------------------------------------------------
----------------------------------------------------------------------