Sylius version(s) affected
2.1
Description
The AcceptLanguageHeaderDocumentationModifier class is responsible for iterating through all registered paths and documenting the Accept-Language header for each of them.
To achieve this, it modifies the operation by adding a parameter that represents the Accept-Language header.
However, when updating the list of paths, the implementation does not account for the fact that multiple methods (e.g., GET, POST, etc.) can share the same path. As a result, it overwrites the existing modifications for a different method when processing the same path. This leads to a loss of the previously added header documentation for other methods on the same path.
How to reproduce
Open the documentation page and note that for endpoints that have the same path but different method only the last one has header documentation.
Possible Solution
Proposal with PR.
Additional Context
No response