Description description = f.getAnnotation(Description.class);
DefaultValue defaultValue = f.getAnnotation(DefaultValue.class);
String swaggerType = convertToSwaggerType(models, fieldType);
SwaggerModelProperty smp;
if (fieldType.isEnum()) {
smp =
new SwaggerModelProperty(swaggerType, getDescription(description), getValue(defaultValue),
getEnumValues(fieldType));
} else if (fieldType.isArray() || Collection.class.isAssignableFrom(fieldType)) {
Boolean uniqueItems = Set.class.isAssignableFrom(fieldType) ? Boolean.TRUE : null;
smp =
new SwaggerModelProperty(swaggerType, getDescription(description), getValue(defaultValue),
uniqueItems, getContainerType(models, f));
} else {
smp = new SwaggerModelProperty(swaggerType, getDescription(description), getValue(defaultValue));
}
mp.put(f.getName(), smp);
}
return new SwaggerModelType(type.getName(), mp);