Skip to content

[validation] @Value annotations with classpath should be of type Resource or similar #1581

Open
@martinlippert

Description

@martinlippert

For code snippets like:

@Value("classpath:somefile.txt")
private Resource myFile;

a validation could run to make sure that - if the @Value annotation points to a resource (e.g. classpath: in this case), that the type if the annotated element (field, parameter) is of type Resource. Otherwise, this might lead to unwanted behavior. E.g. if the type if the field is String, the name of the resource is being injected instead of the content of the file.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions