-
Bug
-
Resolution: Done
-
Major
-
None
-
None
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.
- causes
-
JBEAP-18795 [GSS](7.3.z) @Valid annotation on parameter doesn't get picked up by subclass
- Closed
- is incorporated by
-
JBEAP-19076 Upgrade resteasy from 3.11.0.Final to 3.11.1.Final
- Closed
-
WFLY-13294 Upgrade resteasy from 3.11.0.Final to 3.11.1.Final
- Closed
-
WFLY-13326 Upgrade RESTEasy to 3.11.2.Final
- Closed
-
WFLY-13156 Upgrade resteasy from 3.11.0.Final to 3.11.1.Final
- Closed
- relates to
-
RESTEASY-1459 Method being executed although validation fails
- Resolved
-
RESTEASY-1008 Bean Validation + CDI + field injection not working
- Closed
-
RESTEASY-1186 Constraint violations produced by invalid parameters of a JAXRS resource method are not immediately returned in the Response returned by the method, causing business methods to be called with invalid values.
- Closed
-
RESTEASY-2227 Validate fields/properties after calling @PostConstruct annotated method, if one exists
- Resolved