api-platform / core

The server component of API Platform: hypermedia and GraphQL APIs in minutes
https://api-platform.com
MIT License
2.45k stars 879 forks source link

Custom dto output return tons of @context #6810

Open HrjSnz opened 6 days ago

HrjSnz commented 6 days ago

API Platform version(s) affected: 4.0.7 +

Description
With custom resource and use parameter "output" for custom dto return in response full "@ context" . In version 4.0.6 and below not. If not use "output" everything works fine.

How to reproduce
Just make custom output DTO.

Possible Solution
Is this bug ? I couldn't find any mention of this in the changes.

Additional Context
custom api resource

image

in response tons of "@ context" (around 1k lines)

image
soyuka commented 4 days ago

mark your DTO as an API Resource to avoid that, I'll check if we can do something.

HrjSnz commented 4 days ago

Hi, thanks for tip, but does not work for me. Still getting around 1k lines context. Updated and tested on 4.0.9. Tried add #[ApiResource] to all related DTOs and still not work.

image