Closed joffrey-bion closed 7 years ago
Maybe this could be implemed as/extended with an annotation as well. The annotation could provide example values for fields (e.x. name
) like John Doe
. This would also work on class level. Every time a field with that class is encountered the given example value.
@interface ApiExample {
String value();
ValueType type() default ValueType.TEXT/Integer/Float;
}
Very good suggestion. I don't have time to work on this right now, but I wanted to rework the templates anyway at some point, so I'll keep that in mind.
Specific issue opened for dates: https://github.com/joffrey-bion/livedoc/issues/45
Currently, template generation uses property inspection for any non-primitive and non-enum type. This leads, for instance, to inspection of
java.util.Date
objects, which results in https://github.com/joffrey-bion/livedoc/issues/42.We should allow for custom default values for any given class, and special cases of primitive wrapper classes and enum classes should just be pre-configured. Maybe we should consider pre-configuring
Date
objects as well.