Skip to content

fix(mapper): serialize nested objects - #2259

Open
radoslav-grencik wants to merge 2 commits into
tempestphp:3.xfrom
radoslav-grencik:fix/mapper-serialize-nested-objects
Open

fix(mapper): serialize nested objects#2259
radoslav-grencik wants to merge 2 commits into
tempestphp:3.xfrom
radoslav-grencik:fix/mapper-serialize-nested-objects

Conversation

@radoslav-grencik

Copy link
Copy Markdown
Contributor

Fixes #2258

@xHeaven

xHeaven commented Aug 21, 2026

Copy link
Copy Markdown
Member

This seems to be a bit problematic right now. You're introducing an infinite recursion (nested objects reference each other) and also a performance regression because you are resolving all configured mappers again for every nested object.

The goal idea is good, but I'm afraid this should be a bit deeper refactor than 2 lines of change. I'll try to think of something, let's also wait for @brendt here.

Edit: added a couple failing tests for clarity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ObjectToArrayMapper does not serialize single nested object properties

2 participants