Closed azell closed 8 years ago
If you annotate the interface template it should work right? I don't think Halva needs to do anything additional.
From what I remember from the JSR, annotations must be on the field or a getter
method. A case class would need to look like:
@CaseClass
public interface Foo {
@NotNull
String getValue();
}
I am not sure if Halva supports the getXXX
notation or wants to.
Fixed by #40
https://docs.jboss.org/hibernate/stable/beanvalidation/api/ http://beanvalidation.org/
It would be useful to support JSR-349 annotations on case classes. Unfortunately, the spec only supports property annotations on JavaBean
getter
methods. Halva could apply any supplied annotations on the field.Ex:
could generate:
One implementation is to take the property annotations, filter out
Jackson
annotations and copy the remaining onto the field definition. See http://fasterxml.github.io/jackson-annotations/javadoc/2.7/com/fasterxml/jackson/annotation/JacksonAnnotation.html: