Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3B2BE18296 for ; Wed, 24 Feb 2016 17:19:36 +0000 (UTC) Received: (qmail 75964 invoked by uid 500); 24 Feb 2016 17:19:23 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 75894 invoked by uid 500); 24 Feb 2016 17:19:23 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 75881 invoked by uid 99); 24 Feb 2016 17:19:23 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2016 17:19:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4D619E8EC9; Wed, 24 Feb 2016 17:19:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Date: Wed, 24 Feb 2016 17:19:23 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] cxf git commit: [CXF-6789] Fixing the last AbstractSwaggerFeature commit and updating a spring boot demo Repository: cxf Updated Branches: refs/heads/master 4f1afbf76 -> 73198c5da [CXF-6789] Fixing the last AbstractSwaggerFeature commit and updating a spring boot demo Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/14849cb7 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/14849cb7 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/14849cb7 Branch: refs/heads/master Commit: 14849cb7c8b2117c45196da92df21151f8a78742 Parents: 4f1afbf Author: Sergey Beryozkin Authored: Wed Feb 24 17:18:11 2016 +0000 Committer: Sergey Beryozkin Committed: Wed Feb 24 17:18:11 2016 +0000 ---------------------------------------------------------------------- .../release/samples/jax_rs/jaxrs_spring_boot/README | 12 ++++++++++-- .../src/main/java/sample/rs/service/HelloService.java | 4 ++++ .../java/sample/rs/service/SampleRestApplication.java | 4 +++- .../sample/rs/service/SampleScanRestApplication.java | 2 +- .../sample/rs/service/SampleScanRestApplication2.java | 5 +++-- .../cxf/jaxrs/swagger/AbstractSwaggerFeature.java | 2 +- 6 files changed, 22 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/14849cb7/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/README ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/README b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/README index 5b8fb60..e46b561 100644 --- a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/README +++ b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/README @@ -9,8 +9,16 @@ The sample uses Maven. It can be built and run from the command line: $ mvn spring-boot:run ---- -http://localhost:8080/services/helloservice/sayHello/ApacheCxfUser will now display the output in the browser -like "Hello ApacheCxfUser, Welcome to CXF RS Spring Boot World!!!" +http://localhost:8080/services/helloservice/sayHello/ApacheCxfUser + +will display "Hello ApacheCxfUser, Welcome to CXF RS Spring Boot World!!!" + +http://localhost:8080/services/helloservice/sayHello2/ApacheCxfUser + +will display "Hello2 ApacheCxfUser, Welcome to CXF RS Spring Boot World!!!" + +http://localhost:8080/services/helloservice/swagger.json will return a Swagger JSON +description of services. To run the client from a command line open a new terminal window and run: http://git-wip-us.apache.org/repos/asf/cxf/blob/14849cb7/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/HelloService.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/HelloService.java b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/HelloService.java index beef6f5..069672d 100644 --- a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/HelloService.java +++ b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/HelloService.java @@ -22,10 +22,14 @@ import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; + import org.springframework.stereotype.Service; + +import io.swagger.annotations.Api; @Path("/sayHello") @Service +@Api("/sayHello") public class HelloService { @GET http://git-wip-us.apache.org/repos/asf/cxf/blob/14849cb7/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java index 81df51b..8ee0d14 100644 --- a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java +++ b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java @@ -17,6 +17,8 @@ * under the License. */ package sample.rs.service; +import java.util.Arrays; + import org.apache.cxf.endpoint.Server; import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; import org.apache.cxf.jaxrs.spring.JaxRsConfig; @@ -44,7 +46,7 @@ public class SampleRestApplication { @Bean public Server rsServer() { JAXRSServerFactoryBean endpoint = new JAXRSServerFactoryBean(); - endpoint.setServiceBean(new HelloService()); + endpoint.setServiceBeans(Arrays.asList(new HelloService(), new HelloService2())); endpoint.setAddress("/helloservice"); return endpoint.create(); } http://git-wip-us.apache.org/repos/asf/cxf/blob/14849cb7/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleScanRestApplication.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleScanRestApplication.java b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleScanRestApplication.java index 5be53a8..7567e0a 100644 --- a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleScanRestApplication.java +++ b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleScanRestApplication.java @@ -43,7 +43,7 @@ public class SampleScanRestApplication { // Or create a simple Swagger2Feature @Component-annotated extension // and drop this method if a default feature setup is OK Swagger2Feature feature = new Swagger2Feature(); - feature.setRunAsFilter(true); + //feature.setRunAsFilter(true); return feature; } http://git-wip-us.apache.org/repos/asf/cxf/blob/14849cb7/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleScanRestApplication2.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleScanRestApplication2.java b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleScanRestApplication2.java index 97f3ed7..43c8d37 100644 --- a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleScanRestApplication2.java +++ b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleScanRestApplication2.java @@ -17,7 +17,8 @@ * under the License. */ package sample.rs.service; -import java.util.Collections; +import java.util.Arrays; +import java.util.HashSet; import java.util.Set; import javax.servlet.ServletConfig; @@ -63,7 +64,7 @@ public class SampleScanRestApplication2 { @ApplicationPath("/services/helloservice") public static class JaxrsApplication extends Application { public Set getSingletons() { - return Collections.singleton(new HelloService()); + return new HashSet(Arrays.asList(new HelloService(), new HelloService2())); } } http://git-wip-us.apache.org/repos/asf/cxf/blob/14849cb7/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java ---------------------------------------------------------------------- diff --git a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java index 7408c6d..139f838 100644 --- a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java +++ b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java @@ -92,7 +92,7 @@ public abstract class AbstractSwaggerFeature extends AbstractFeature { serviceClasses.add(cri.getServiceClass()); } String sharedPackage = PackageUtils.getSharedPackageName(serviceClasses); - if (!StringUtils.isEmpty(getResourcePackage())) { + if (!StringUtils.isEmpty(sharedPackage)) { setResourcePackage(sharedPackage); } }