Skip to content

[2.1][API] The class that modifies the documentation to add the Accept-Language header does not work properly #17857

@nicolalazzaro

Description

@nicolalazzaro

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIAPIs related issues and PRs.BugConfirmed bugs or bugfixes.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions