mapstruct / mapstruct/mapstruct-idea

Check unknown target properties in new `@Ignored` annotation

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

Nobody has claimed this yet.

feature
Dominant language
Java
Stars
168
Forks
41
PR merge metrics
No merged PRs in 30d

Description

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" })

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.

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.