mtedone / podam

PODAM - POjo DAta Mocker
https://mtedone.github.io/podam
MIT License
326 stars 749 forks source link

Support for ignoring user defined annotations #282

Closed DareUrDream closed 4 years ago

DareUrDream commented 4 years ago

There are multiple situations that I come across over the last few projects where quite a few custom annotations are used.

In the below example, MyCustomAnnotation is something I am not worried about and would like Podam to set a value to it. But the default behaviour now is put a WARN message and ignore the field.

@MyCustomAnnotation(val = "ABC", length = 10)
@NotBlank(message = "Name is mandatory")
private String name;

I would like to propose that in addition to existing behaviour of ignoring such fields, it would be ideal to allow the consumer specify an ignored list of annotations. That way other annotation can get processed and default values could still be set. This gives the user a lot of flexibility.

daivanov commented 4 years ago

In fact this is how Podam works at the moment. We ignore custom annotations (of course, we do not know what they mean) and we will follow javax.validation.constraints. You can see the associated tests.

Thanks, Daniil

daivanov commented 4 years ago

If you don't mind I will close the issue.

Thanks, Daniil