Skip to content

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

Closed
@sbrannen

Description

@sbrannen

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.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions