private JAllowableValues allowableValues;
private String paramType;
private String paramAccess;
*/
JsonNode node = jp.readValueAsTree();//jp.getCodec().readTree(jp)
JParameter parameter = new JParameter();
parameter.setName(Utils.getStringFromJsonNode(node, "name"));
parameter.setDescription(Utils.getStringFromJsonNode(node, "description"));
parameter.setDefaultValue(Utils.getStringFromJsonNode(node, "defaultValue"));
parameter.setRequired(Utils.getBooleanFromJsonNode(node, "required"));
parameter.setAllowMultiple(Utils.getBooleanFromJsonNode(node, "allowMultiple"));
String type = Utils.getStringFromJsonNode(node, "type");
String format = Utils.getStringFromJsonNode(node, "format");
parameter.setDataType(SwaggerSerializers.fromJsonSchemaType(new Tuple2<String, String>(type, format)));
JsonNode jsonNode = node.get("items");
if (jsonNode != null) {
JModelRef items = jsonNode.traverse(jp.getCodec()).readValueAs(JModelRef.class);
if ("array".equalsIgnoreCase(type)) {
if (Utils.getBooleanFromJsonNode(node, "uniqueItems")) {
parameter.setDataType("Set["+items.getRef()+"]");
} else {
parameter.setDataType("List["+items.getRef()+"]");
}
}
}
parameter.setAllowableValues(Utils.getAllowableValuesFromJsonNode(node));
parameter.setParamType(Utils.getStringFromJsonNode(node, "paramType"));
parameter.setParamAccess(Utils.getStringFromJsonNode(node, "paramAccess"));
return parameter;
}