@Override
  public void define(WebService.NewController controller) {
    WebService.NewAction action = controller
      .createAction("response_example")
      .setDescription("Display web service response example")
      .setResponseExample(getClass().getResource("response_example-example.json"))
      .setSince("4.4")
      .setHandler(this);

    action.createParam("controller")
      .setRequired(true)
      .setDescription("Controller of the web service")
      .setExampleValue("api/issues");

    action.createParam("action")
      .setRequired(true)
      .setDescription("Action of the web service")
      .setExampleValue("search");
  }
@Test
  public void response_example() {
    MetricWs metricWs = new MetricWs();
    metricWs.define(context);

    newRequest()
      .setParam("controller", "api/metric")
      .setParam("action", "create")
      .execute()
      .assertJson(getClass(), "response_example.json");
  }