HIGUCHI Yuta
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
......@@ -18,6 +18,7 @@ package org.onosproject.maven;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.base.Throwables;
import com.google.common.io.ByteStreams;
import com.google.common.io.Files;
import com.google.gson.JsonParser;
......@@ -295,7 +296,10 @@ public class OnosSwaggerMojo extends AbstractMojo {
+ param + ".json");
definitions.putPOJO(param, jsonParser.parse(new FileReader(config)));
} catch (IOException e) {
e.printStackTrace();
getLog().error(String.format("Could not process %s in %s@%s: %s",
tag.getName(), tag.getContext(), tag.getLineNumber(),
e.getMessage()));
throw Throwables.propagate(e);
}
});
......
......@@ -56,8 +56,9 @@ public class DeviceKeyWebResource extends AbstractWebResource {
* Returns array of all device keys.
*
* @return 200 OK
* @onos.rsModel DeviceKeysGet
*/
// FIXME DeviceKeysGet.json not found
// * @onos.rsModel DeviceKeysGet
@GET
public Response getDeviceKeys() {
Iterable<DeviceKey> deviceKeys = get(DeviceKeyService.class).getDeviceKeys();
......@@ -70,8 +71,9 @@ public class DeviceKeyWebResource extends AbstractWebResource {
*
* @param id device identifier
* @return 200 OK
* @onos.rsModel DeviceKeyGet
*/
// FIXME DeviceKeyGet.json not found
// * @onos.rsModel DeviceKeyGet
@GET
@Path("{id}")
public Response getDeviceKey(@PathParam("id") String id) {
......@@ -86,8 +88,9 @@ public class DeviceKeyWebResource extends AbstractWebResource {
* @param stream input JSON
* @return status of the request - CREATED if the JSON is correct,
* BAD_REQUEST if the JSON is invalid
* @onos.rsModel IntentHost
*/
// FIXME wrong schema definition?
// * @onos.rsModel IntentHost
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
......