Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Support passing custom annotations to generated code

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

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
devtools

Research direction

Start by reading PR #2792 and issue #1574 to understand the new AnnotateWith API, then inspect the IntelliJ plugin's existing support for generated annotations. Done means implementing and validating the listed completion and error checks, including target compatibility, duplicate names, value types, and arrays.

Written by the indexing model from the issue text.

Description

feature

With the work in PR https://github.com/mapstruct/mapstruct/pull/2792 being done for https://github.com/mapstruct/mapstruct/issues/1574 it would be good to provide some support for the new API in the IntelliJ plugin as well.

Some things that we should do:

  • Auto completion support for AnnotateWith.Element#name and error when name does not exist in target enum.
  • Smart auto completion for AnnotateWith.Element#classes (pick the class type based on the one in the annotation
  • Auto completion for AnnotateWith.Element#enums and error when enum value does not exist
  • Annotation cannot annotated the generated class / method (it doesn't have the right target element type)
  • Error when more than one value type is provided, eg. shorts() and strings()
  • Error when duplicated AnnotateWith.Element#name (more than one having the same name
  • Error when value does not match target annotation value type
  • Error when using array value, but target value is not an array
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.