private void arrayExample(StringBuilder sb, int maxlength, String indent, JsonSchema schema,
Map<String, JsonSchema> refs, Set<String> followed, Set<String> referenced) {
sb.append("[\n").append(indent).append(" ");
ArraySchema as = schema.asArraySchema();
if (as.getItems() == null) {
sb.append(" ... ]");
} else if (as.getItems().isSingleItems()) {
example(sb, maxlength, indent + " ", as.getItems().asSingleItems().getSchema(), refs, followed, referenced);
sb.append(",\n").append(indent).append(" ...\n").append(indent).append("]");
} else if (as.getItems().isArrayItems()) {
ArrayItems items = as.getItems().asArrayItems();
for (JsonSchema item : items.getJsonSchemas()) {
sb.append("\n").append(indent);
example(sb, maxlength, indent + " ", item, refs, followed, referenced);
sb.append(",");
}
sb.append("]");
} else {
throw new UnsupportedOperationException(as.getItems().toString());
}
}