Skip to content

Adding new Deserializer to Rest API removes other Deserializers  #26433

Closed
@jakwinkler

Description

@jakwinkler

Preconditions (*)

  1. Magento 2.2.x / Magento 2.3.x both CE / EE & 2.4-develop

Steps to reproduce (*)

  1. Create a new module which will add new webapi route
  2. Create a new deserializer using di.xml in your module
<type name="Magento\Framework\Webapi\Rest\Request\DeserializerFactory">
    <arguments>
        <argument name="deserializers" xsi:type="array">
            <item name="text_plain" xsi:type="array">
                <item name="type" xsi:type="string">text/plain</item>
                <item name="model" xsi:type="string">Custom\Module\Webapi\Rest\Request\Deserializer\Plain</item>
            </item>
        </argument>
    </arguments>
</type>

Expected result (*)

  1. New content type accepted by REST API

Actual result (*)

  1. All CORE defined content types for API are no longer working and return 400 error
    image

  2. Only new defined content type is accepted

It was my understanding that DI.XML is used to extend CORE features, not OVERWRITE them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: APIsCDIssue recommended for the contribution dayComponent: ApiUse with concrete module component label E.g. "Component: Api" + "Catalog"Component: ConfigIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReported on 2.2.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S1Affects critical data or functionality and forces users to employ a workaround.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions