mapstruct / mapstruct/mapstruct

Defining an interface for each transformation is a hassle

Open
#3,337 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

closing-when-no-response
Dominant language
Java
Stars
7.7k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

### Use case

It is troublesome to define an interface for each conversion. Is there a shorthand way to write it? Simple as this:
Car car = new Car();
CarDto carDto = convert. convert(car);

Some implementations are as follows:
https://github.com/linpeilie/mapstruct-plus

mapstruct itself should have such a function.

### Generated Code

_No response_

### Possible workarounds

_No response_

### MapStruct Version

_No response_

Contributor guide

Open the contributing guide

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

No MapStruct file, test, or entry point is named; begin by reviewing the repository and comparing the linked mapstruct-plus implementation. Done would require an agreed shorthand for conversions without defining an interface for each transformation, along with specified generated-code behavior and tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.