Committed by
Gerrit Code Review
Fail the build if @onos.rsModel specified model json does not exist
- Commenting out DeviceKey related @onos.rsModel issues Change-Id: Id11730d7cf63aa32038538d9392a980e2f995ab5
Showing
2 changed files
with
11 additions
and
4 deletions
... | @@ -18,6 +18,7 @@ package org.onosproject.maven; | ... | @@ -18,6 +18,7 @@ package org.onosproject.maven; |
18 | import com.fasterxml.jackson.databind.ObjectMapper; | 18 | import com.fasterxml.jackson.databind.ObjectMapper; |
19 | import com.fasterxml.jackson.databind.node.ArrayNode; | 19 | import com.fasterxml.jackson.databind.node.ArrayNode; |
20 | import com.fasterxml.jackson.databind.node.ObjectNode; | 20 | import com.fasterxml.jackson.databind.node.ObjectNode; |
21 | +import com.google.common.base.Throwables; | ||
21 | import com.google.common.io.ByteStreams; | 22 | import com.google.common.io.ByteStreams; |
22 | import com.google.common.io.Files; | 23 | import com.google.common.io.Files; |
23 | import com.google.gson.JsonParser; | 24 | import com.google.gson.JsonParser; |
... | @@ -295,7 +296,10 @@ public class OnosSwaggerMojo extends AbstractMojo { | ... | @@ -295,7 +296,10 @@ public class OnosSwaggerMojo extends AbstractMojo { |
295 | + param + ".json"); | 296 | + param + ".json"); |
296 | definitions.putPOJO(param, jsonParser.parse(new FileReader(config))); | 297 | definitions.putPOJO(param, jsonParser.parse(new FileReader(config))); |
297 | } catch (IOException e) { | 298 | } catch (IOException e) { |
298 | - e.printStackTrace(); | 299 | + getLog().error(String.format("Could not process %s in %s@%s: %s", |
300 | + tag.getName(), tag.getContext(), tag.getLineNumber(), | ||
301 | + e.getMessage())); | ||
302 | + throw Throwables.propagate(e); | ||
299 | } | 303 | } |
300 | }); | 304 | }); |
301 | 305 | ... | ... |
... | @@ -56,8 +56,9 @@ public class DeviceKeyWebResource extends AbstractWebResource { | ... | @@ -56,8 +56,9 @@ public class DeviceKeyWebResource extends AbstractWebResource { |
56 | * Returns array of all device keys. | 56 | * Returns array of all device keys. |
57 | * | 57 | * |
58 | * @return 200 OK | 58 | * @return 200 OK |
59 | - * @onos.rsModel DeviceKeysGet | ||
60 | */ | 59 | */ |
60 | +// FIXME DeviceKeysGet.json not found | ||
61 | +// * @onos.rsModel DeviceKeysGet | ||
61 | @GET | 62 | @GET |
62 | public Response getDeviceKeys() { | 63 | public Response getDeviceKeys() { |
63 | Iterable<DeviceKey> deviceKeys = get(DeviceKeyService.class).getDeviceKeys(); | 64 | Iterable<DeviceKey> deviceKeys = get(DeviceKeyService.class).getDeviceKeys(); |
... | @@ -70,8 +71,9 @@ public class DeviceKeyWebResource extends AbstractWebResource { | ... | @@ -70,8 +71,9 @@ public class DeviceKeyWebResource extends AbstractWebResource { |
70 | * | 71 | * |
71 | * @param id device identifier | 72 | * @param id device identifier |
72 | * @return 200 OK | 73 | * @return 200 OK |
73 | - * @onos.rsModel DeviceKeyGet | ||
74 | */ | 74 | */ |
75 | +// FIXME DeviceKeyGet.json not found | ||
76 | +// * @onos.rsModel DeviceKeyGet | ||
75 | @GET | 77 | @GET |
76 | @Path("{id}") | 78 | @Path("{id}") |
77 | public Response getDeviceKey(@PathParam("id") String id) { | 79 | public Response getDeviceKey(@PathParam("id") String id) { |
... | @@ -86,8 +88,9 @@ public class DeviceKeyWebResource extends AbstractWebResource { | ... | @@ -86,8 +88,9 @@ public class DeviceKeyWebResource extends AbstractWebResource { |
86 | * @param stream input JSON | 88 | * @param stream input JSON |
87 | * @return status of the request - CREATED if the JSON is correct, | 89 | * @return status of the request - CREATED if the JSON is correct, |
88 | * BAD_REQUEST if the JSON is invalid | 90 | * BAD_REQUEST if the JSON is invalid |
89 | - * @onos.rsModel IntentHost | ||
90 | */ | 91 | */ |
92 | +// FIXME wrong schema definition? | ||
93 | +// * @onos.rsModel IntentHost | ||
91 | @POST | 94 | @POST |
92 | @Consumes(MediaType.APPLICATION_JSON) | 95 | @Consumes(MediaType.APPLICATION_JSON) |
93 | @Produces(MediaType.APPLICATION_JSON) | 96 | @Produces(MediaType.APPLICATION_JSON) | ... | ... |
-
Please register or login to post a comment