Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom default values support in templates #44

Closed
joffrey-bion opened this issue Sep 29, 2017 · 3 comments
Closed

Add custom default values support in templates #44

joffrey-bion opened this issue Sep 29, 2017 · 3 comments

Comments

@joffrey-bion
Copy link
Owner

joffrey-bion commented Sep 29, 2017

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 #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.

@ST-DDT
Copy link

ST-DDT commented Sep 29, 2017

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;

}

@joffrey-bion
Copy link
Owner Author

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.

@joffrey-bion
Copy link
Owner Author

Specific issue opened for dates: #45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants