micronaut-projects / micronaut-projects/micronaut-validation
Micronaut Validation documentation incorrect statement about @Introspected
- Dominant language
- Java
- Stars
- 9
- Forks
- 8
- Avg merge
- 20h 7m
- Merged PRs (30d)
- 9
Description
### Expected Behavior
Validation documentation shouldn't state that @Introspected annotation is required for validation.
### Actual Behaviour
Current Micronaut Validation documentation (https://micronaut-projects.github.io/micronaut-validation/snapshot/guide/) states that:
To validate data classes, e.g. POJOs (typically used in JSON interchange), the class **must be** annotated with [@Introspected](https://docs.micronaut.io/latest/api/io/micronaut/core/annotation/Introspected) (see [Micronaut Guide Introspection section](https://docs.micronaut.io/latest/guide/#introspection)) or, if the class is external, be imported by the @Introspected annotation.
However that's not true as per Micronaut 4.1.4.
So here's our POJO:
```
public class Product {
@NotEmpty
private String name;
private int id;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
}
```
And our configuration class:
```
@SerdeImport(Product.class)
public class BeanValidationConfiguration {
}
```
So there's no @Introspected here (@SerdeImport is meta-annotation but doesn't contain it) however Jakarta Validation works which was confirmed by our tests.
### Steps To Reproduce
_No response_
### Environment Information
_No response_
### Example Application
_No response_
### Version
4.1.4
Contributor guide
Research direction
Start with the validation documentation at https://micronaut-projects.github.io/micronaut-validation/snapshot/guide/ and locate the statement that @Introspected is required for validating data classes. Update the wording to reflect the reported @SerdeImport example, then verify that the documentation no longer makes the incorrect requirement claim.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100