jakartaee / jakartaee/rest

Clarify role of @PostConstruct annotated methods in validation steps

Open
#759 19 comments 2 reactions 1 assignee Claimed by @ronsigal View on GitHub
clarification spec
Dominant language
Java
Stars
400
Forks
143
PR merge metrics
No merged PRs in 30d

Description

The first two validation steps are

* Phase 1 Inject field values and initialize bean properties as described in Section 3.2.
* Phase 2 Validate annotations on fields, property getters (if enabled) and the resource class. The order in which these validations are executed is implementation dependent.

In the case that CDI is enabled, RESTEasy currently initiates field/property validation at the end of InjectionTarget.inject(). However, since further initialization can take place in a @PostConstruct annotated method, field/property validation should be initiated from InjectionTarget.postConstruct().

It would be helpful if the role played by @PostConstruct methods were mentioned explicitly in the specification.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.