Skip to content

REST API Attribute Update fails without attribute_id #40458

@cmuench

Description

@cmuench

Preconditions and environment

  1. Magento 2.4.8-p3
  2. REST API enabled

Steps to reproduce

Update without attribute_id

  1. Send a PUT request to /V1/products/attributes/{attributeCode}.
  2. In the payload, include attribute_code but omit attribute_id.

Can be tested e.g. with the "color" attribute.

Expected result

The API should recognize the existing attribute by attribute_code from the URL and perform an update.

Actual result

Response 400 Bad Request:

{
  "message": "%1 already exists.",
  "parameters": [
    "Attribute with the same code"
  ]
}

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

Labels

Issue: needs updateAdditional information is require, waiting for responseReported on 2.4.8-p3Indicates original Magento version for the Issue report.

Type

No type

Projects

Status

Needs Update

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions