podam icon indicating copy to clipboard operation
podam copied to clipboard

Support for ignoring user defined annotations

Open DareUrDream opened this issue 6 years ago • 2 comments

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.

DareUrDream avatar Jul 05 '20 10:07 DareUrDream

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 avatar Jul 05 '20 19:07 daivanov

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

Thanks, Daniil

daivanov avatar Jul 10 '20 08:07 daivanov