Skip to content

Document that attribute is optional in @⁠AliasFor for overrides with the same name #34641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sbrannen opened this issue Mar 24, 2025 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task
Milestone

Comments

@sbrannen
Copy link
Member

Originally, the attribute attribute in @AliasFor was required; however, we later made it optional when the aliasing attribute and the aliased attribute (in a meta-annotation) have the same name.

For example, the path attribute in @GetMapping omits the attribute = "path" declaration, since the annotation = RequestMapping.class is sufficient.

/**
 * Alias for {@link RequestMapping#path}.
 */
@AliasFor(annotation = RequestMapping.class)
String[] path() default {};

We should therefore document this feature in the Javadoc for @AliasFor to make users aware of this.

@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task labels Mar 24, 2025
@sbrannen sbrannen added this to the 7.0.0-M4 milestone Mar 24, 2025
@sbrannen sbrannen self-assigned this Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

1 participant