From e9ff86cbd26db4a699a17d7d60727334e219b6d0 Mon Sep 17 00:00:00 2001 From: Murali-P Date: Wed, 25 Apr 2018 11:23:07 +0530 Subject: Enable swagger documentation for API Swagger UI and Swagger docs Issue-ID: VNFSDK-157 Change-Id: I9aeda5c364741c975a8d0d8b788a22c9d3f5f39f Signed-off-by: Murali-P --- vnfmarket-be/deployment/zip/pom.xml | 8 + vnfmarket-be/vnf-sdk-marketplace/pom.xml | 407 +++++++++++---------- .../src/main/webapp/WEB-INF/web.xml | 23 +- .../src/main/webapp/apidocs/index.html | 61 +++ 4 files changed, 303 insertions(+), 196 deletions(-) create mode 100644 vnfmarket-be/vnf-sdk-marketplace/src/main/webapp/apidocs/index.html (limited to 'vnfmarket-be') diff --git a/vnfmarket-be/deployment/zip/pom.xml b/vnfmarket-be/deployment/zip/pom.xml index e0b4e7e9..d2f562f7 100644 --- a/vnfmarket-be/deployment/zip/pom.xml +++ b/vnfmarket-be/deployment/zip/pom.xml @@ -69,6 +69,7 @@ ant.mkdir(dir: "${deployUnzip}/webapps/ROOT") ant.mkdir(dir: "${deployUnzip}/webapps/onapui") + ant.mkdir(dir: "${deployUnzip}/webapps/apidocs") ant.copy(todir: "${deployUnzip}") { fileset(dir: "${basedir}/src/main/release"){ @@ -83,6 +84,13 @@ ant.copy(todir: "${deployUnzip}/webapps/onapui") { fileset(dir: "${project.build.directory}/../../../../vnfmarket/src/main/webapp") } + + ant.copy(todir: "${deployUnzip}/webapps/apidocs") { + fileset(dir: "${project.build.directory}/../../../vnf-sdk-marketplace/target/swagger-ui-master/dist") { + exclude(name: "index.html") + } + fileset(dir: "${project.build.directory}/../../../vnf-sdk-marketplace/src/main/webapp/apidocs") + } ant.zip(destfile: "${deployFolder}/${outfileName}") { fileset(dir: "${deployUnzip}") diff --git a/vnfmarket-be/vnf-sdk-marketplace/pom.xml b/vnfmarket-be/vnf-sdk-marketplace/pom.xml index f78b00b8..eddf022c 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/pom.xml +++ b/vnfmarket-be/vnf-sdk-marketplace/pom.xml @@ -1,206 +1,227 @@ + License, Version 2.0 (the "License"); you may not use this file except in + compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed + under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + OR CONDITIONS OF ANY KIND, either express or implied. See the License for + the specific language governing permissions and limitations under the License. --> - - org.onap.vnfsdk.refrepo - vnf-sdk-marketplace-core-parent - 1.1.0 - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + org.onap.vnfsdk.refrepo + vnf-sdk-marketplace-core-parent + 1.1.0 + - 4.0.0 - vnf-sdk-marketplace - 1.1.0 - vnf-sdk-marketplace/vnf-sdk-marketplace - war + 4.0.0 + vnf-sdk-marketplace + 1.1.0 + vnf-sdk-marketplace/vnf-sdk-marketplace + war - - UTF-8 - 3.2.3 - - false - false - + + UTF-8 + 3.2.3 + + false + false + 3.12.0 + - - - org.apache.cxf - cxf-rt-frontend-jaxrs - ${cxf.version} - - - org.apache.cxf - cxf-rt-rs-client - ${cxf.version} - - - org.apache.cxf - cxf-rt-transports-http-hc - ${cxf.version} - - - log4j - log4j - 1.2.16 - - - io.dropwizard - dropwizard-assets - 1.2.4 - - - org.eclipse.persistence - javax.persistence - 2.1.0 - + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf.version} + + + org.apache.cxf + cxf-rt-rs-client + ${cxf.version} + + + org.apache.cxf + cxf-rt-transports-http-hc + ${cxf.version} + + + log4j + log4j + 1.2.16 + - - io.swagger - swagger-jersey2-jaxrs - 1.5.18 - - + + org.eclipse.persistence + javax.persistence + 2.1.0 + + + + io.swagger + swagger-jersey2-jaxrs + 1.5.19 + + + + + org.glassfish.jersey.media + jersey-media-multipart + 2.25.1 + + + org.glassfish.jersey.containers + jersey-container-jetty-servlet + 2.25.1 + + + org.glassfish.jersey.bundles.repackaged + jersey-guava + 2.25.1 + + + org.apache.httpcomponents + httpmime + 4.5.3 + + + + com.eclipsesource.jaxrs + consumer + + + com.eclipsesource.jaxrs + jersey-all + + + 5.0 + + + + com.google.code.gson + gson + 2.8.2 + + + org.postgresql + postgresql + 42.1.1 + + + org.mybatis + mybatis + 3.2.7 + + + + junit + junit + 4.12 + test + + + org.powermock + powermock-module-junit4 + 1.4.10 + test + + + org.powermock + powermock-api-mockito + 1.4.10 + test + + + org.jmockit + jmockit + 1.19 + test + + + org.jmockit + jmockit-coverage + 1.19 + test + + + org.apache.ant + ant + 1.8.2 + test + - - org.glassfish.jersey.media - jersey-media-multipart - 2.25.1 - - - org.glassfish.jersey.containers - jersey-container-jetty-servlet - 2.25.1 - - - org.apache.httpcomponents - httpmime - 4.5.3 - - - - com.eclipsesource.jaxrs - consumer - - - com.eclipsesource.jaxrs - jersey-all - - - 5.0 - - - - com.google.code.gson - gson - 2.3.1 - - - org.postgresql - postgresql - 42.1.1 - - - org.mybatis - mybatis - 3.2.7 - - - - junit - junit - 4.12 - test - - - org.powermock - powermock-module-junit4 - 1.4.10 - test - - - org.powermock - powermock-api-mockito - 1.4.10 - test - - - org.jmockit - jmockit - 1.19 - test - - - org.jmockit - jmockit-coverage - 1.19 - test - - - org.apache.ant - ant - 1.8.2 - test - + + org.apache.commons + commons-io + 1.3.2 + + + commons-io + commons-io + 2.4 + + + com.google.guava + guava + 20.0 + - - org.apache.commons - commons-io - 1.3.2 - - - commons-io - commons-io - 2.4 - - - org.glassfish.jersey.bundles.repackaged - jersey-guava - 2.6 - - - - org.onap.vnfsdk.validation - validation-csar - 1.1.1 - - - - - all-tests - - all-tests - false - - - - - ROOT - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.20 - - always - ${surefireArgLine} - ${maven.test.skip} - ${maven.test.failure.ignore} - - - **/IT*.java - - - - - + + + org.onap.vnfsdk.validation + validation-csar + 1.1.1 + + + + + all-tests + + all-tests + false + + + + + ROOT + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.20 + + always + ${surefireArgLine} + ${maven.test.skip} + ${maven.test.failure.ignore} + + + **/IT*.java + + + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.2.1 + + + swagger-ui + + wget + + + https://github.com/swagger-api/swagger-ui/archive/master.tar.gz + true + ${project.build.directory} + + + + + + diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/webapp/WEB-INF/web.xml b/vnfmarket-be/vnf-sdk-marketplace/src/main/webapp/WEB-INF/web.xml index 8dc5575c..cf229269 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/main/webapp/WEB-INF/web.xml +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/webapp/WEB-INF/web.xml @@ -9,17 +9,34 @@ org.glassfish.jersey.servlet.ServletContainer jersey.config.server.provider.packages - org.onap.vnfsdk.marketplace.resource + io.swagger.jaxrs.listing, + org.onap.vnfsdk.marketplace.resource + jersey.config.server.provider.classnames org.glassfish.jersey.media.multipart.MultiPartFeature - + + 1 Jersey RESTful Application /onapapi/vnfsdk-marketplace/v1/* - + + + + Jersey2Config + io.swagger.jersey.config.JerseyJaxrsConfig + + api.version + 1.0.0 + + + swagger.api.basepath + http://localhost:8702//onapapi/vnfsdk-marketplace/v1 + + 2 + CorsFilter diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/webapp/apidocs/index.html b/vnfmarket-be/vnf-sdk-marketplace/src/main/webapp/apidocs/index.html new file mode 100644 index 00000000..47f9c8ac --- /dev/null +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/webapp/apidocs/index.html @@ -0,0 +1,61 @@ + + + + + + Swagger UI + + + + + + + + +
+ + + + + + -- cgit 1.2.3-korg