Check unknown target properties in new `@Ignored` annotation

Open
#238 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
devtools

Research direction

Start by locating MapstructTargetReference and the handling of targets in the @Ignored annotation. Verify unknown simple targets, nested properties such as driver.name, and array syntax with multiple targets; done means each invalid target is reported as a compilation error.

Written by the indexing model from the issue text.

Description

feature

Referencing a target that does not exist results in a compilation error.
Therefore we should support the check of target properties (MapstructTargetReference) for that annotation.

interface FooMapper {

    @Ignored(targets = "nonExistent") // mark this as unknown
    CarDto map(Car car);
}

This should also work for nested properties like @Ignored(targets = "driver.name").

Beware that writing it as an array must also work:

@Ignored(targets = { "a", "b" })
Dominant language
Java
Stars
168
Forks
41
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mapstruct/mapstruct-idea

All issues in mapstruct/mapstruct-idea

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.