-
Bug
-
Resolution: Done
-
Major
-
7.2.6.GA
When having an interface with method:
@POST Response createDummy(@Valid DummyClass payload);
And a subclass that implements it with:
@Override
public Response createDummy(DummyClass payload)
The code will only validate the parameter if @Valid is added on the subclass. He interprets that as a bug. Looking at the spec, I believe he is correct, going by section 7.5
From the JAX-RS spec
> *Annotation Inheritance*
> The rules for inheritance of constraint annotation are defined in [16]. It is worth noting that these rules
> are incompatible with those defined in Section 3.6. Generally speaking, constraint annotations in [16] are
> cumulative (can be strengthen) across a given type hierarchy while JAX-RS annotations are inherited or,
> overridden and ignored.
> The goal of this specification is to enable validation of JAX-RS resources by leveraging existing Bean
> Validation implementations. Therefore, JAX-RS implementations MUST follow the constraint annotation
> rules defined in [16].
It appears to work with @Valid in JBoss EAP 6, though I know that implementation was tech preview.
While adding @Valid will in every subclass will work, this would be a large undertaking for the customer, so they would like to know if there is an easier workaround.
- is caused by
-
RESTEASY-2503 After first invocation on an EJB, class/field/property constraints don't get checked
- Resolved
- is incorporated by
-
JBEAP-18797 (7.3.z) Upgrade resteasy from 3.9.3.SP1 to 3.11.1.Final
- Closed