mapstruct / mapstruct/mapstruct

Retrieve mappings programmatically

Open
#918 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
7.7k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Hi,

is there any way to retrieve mappings via API? It would be nice to know what property of type A becomes what property of type B. I'll try to clarify the request using an example: mapping a filter or sort clause from DTO to DO. Consider for instance

@Mapping(source = "numberOfSeats", target = "seatCount")
CarDto carToDto(Car car);

@InheritInverseConfiguration
Car carDtoToCar(CarDto carDto);

Suppose the UI has a toggle to filter the car based on the number of seats: CarDTO is filtered on seatCount property while Car is filtered on numberOfSeats. I'd like to have a way to retrieve this information in order to convert Filter/Sort objects between frontend and backend. Is there any way I can achieve this with the existing APIs?

Thank you,

lorenzo

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 files, tests, or entry points are identified in the issue. Start by reviewing the existing MapStruct APIs and how the example's mapping metadata is represented; done means a defined, supported way to retrieve mappings for converting filter or sort properties between DTO and domain objects.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.