Update RS API to 2.1 and add support for PATCH requests in Swagger
Change-Id: Id08e254ec53c5512f03e01568ca91dff193d0297
diff --git a/lib/BUCK b/lib/BUCK
index 69d2fbb..0c7ecc1 100644
--- a/lib/BUCK
+++ b/lib/BUCK
@@ -1,4 +1,4 @@
-# ***** This file was auto-generated at Tue, 17 Oct 2017 17:41:52 GMT. Do not edit this file manually. *****
+# ***** This file was auto-generated at Tue, 17 Oct 2017 22:57:24 GMT. Do not edit this file manually. *****
# ***** Use onos-lib-gen *****
pass_thru_pom(
@@ -533,10 +533,10 @@
remote_jar (
name = 'javax.ws.rs-api',
- out = 'javax.ws.rs-api-2.0.1.jar',
- url = 'mvn:javax.ws.rs:javax.ws.rs-api:jar:2.0.1',
- sha1 = '104e9c2b5583cfcfeac0402316221648d6d8ea6b',
- maven_coords = 'javax.ws.rs:javax.ws.rs-api:2.0.1',
+ out = 'javax.ws.rs-api-2.1.jar',
+ url = 'mvn:javax.ws.rs:javax.ws.rs-api:jar:2.1',
+ sha1 = '426a0862406536e690c7caa8bb6ed32191986fac',
+ maven_coords = 'javax.ws.rs:javax.ws.rs-api:2.1',
visibility = [ 'PUBLIC' ],
)
diff --git a/lib/deps.json b/lib/deps.json
index a18b766..bb05865 100644
--- a/lib/deps.json
+++ b/lib/deps.json
@@ -155,7 +155,7 @@
"jackson-databind": "mvn:com.fasterxml.jackson.core:jackson-databind:2.8.8",
"javax.annotation-api": "mvn:javax.annotation:javax.annotation-api:1.2",
"javax.inject": "mvn:org.glassfish.hk2.external:javax.inject:2.5.0-b32",
- "javax.ws.rs-api": "mvn:javax.ws.rs:javax.ws.rs-api:2.0.1",
+ "javax.ws.rs-api": "mvn:javax.ws.rs:javax.ws.rs-api:2.1",
"jersey-client": "mvn:org.glassfish.jersey.core:jersey-client:2.25.1",
"jersey-common": "mvn:org.glassfish.jersey.core:jersey-common:2.25.1",
"jersey-container-jetty-http": "mvn:org.glassfish.jersey.containers:jersey-container-jetty-http:2.25.1",
diff --git a/tools/build/buck-plugin/src/main/java/org/onosproject/onosjar/SwaggerGenerator.java b/tools/build/buck-plugin/src/main/java/org/onosproject/onosjar/SwaggerGenerator.java
index 40ba70d..88850e8 100644
--- a/tools/build/buck-plugin/src/main/java/org/onosproject/onosjar/SwaggerGenerator.java
+++ b/tools/build/buck-plugin/src/main/java/org/onosproject/onosjar/SwaggerGenerator.java
@@ -55,6 +55,7 @@
private static final String PATH_PARAM = "javax.ws.rs.PathParam";
private static final String QUERY_PARAM = "javax.ws.rs.QueryParam";
private static final String POST = "javax.ws.rs.POST";
+ private static final String PATCH = "javax.ws.rs.PATCH";
private static final String GET = "javax.ws.rs.GET";
private static final String PUT = "javax.ws.rs.PUT";
private static final String DELETE = "javax.ws.rs.DELETE";
@@ -213,7 +214,8 @@
javaClass.getMethods().forEach(javaMethod -> {
javaMethod.getAnnotations().forEach(annotation -> {
String name = annotation.getType().getName();
- if (name.equals(POST) || name.equals(GET) || name.equals(DELETE) || name.equals(PUT)) {
+ if (name.equals(PATCH) || name.equals(POST) || name.equals(GET) || name.equals(DELETE) ||
+ name.equals(PUT)) {
// substring(12) removes "javax.ws.rs."
String method = annotation.getType().toString().substring(12).toLowerCase();
processRestMethod(javaMethod, method, pathMap, resourcePath, tagArray, definitions, srcDirectory);