public void handle(Request request, Response response) {
JsonWriter writer = response.newJsonWriter().beginObject().name("qualitygates").beginArray();
for (QualityGateDto qgate : qualityGates.list()) {
QGatesWs.writeQualityGate(qgate, writer);
}
writer.endArray();
QualityGateDto defaultQgate = qualityGates.getDefault();
if (defaultQgate != null) {
writer.prop("default", defaultQgate.getId());
}
writer.endObject().close();