Skip to content

Validation on required attributes when updating a product on the REST API doesn't check the attribute set of the product. #9059

@alexgmin

Description

@alexgmin

Preconditions

  1. Magento 2.1.2
  2. PHP 5.6
  3. MySQL 5.7

Steps to reproduce

  1. Create two attribute sets.
  2. Create a required attribute
  3. Assign the attribute to the first attribute set, but not the second.
  4. Create two products, one for each attribute set.
  5. Try to update the product on the attribute set without the required attribute with the REST API without that attribute.

Expected result

  1. The product is updated and nothing complains about the required attribute, since is not required for the attribute set of the product.

Actual result

  1. Magento doesn't check the attribute set of the product when using the API, so it throws an exception complaining about the missing attribute.
    "message": "The value of attribute \"foo"\ must be set",

The process works normally when doing it on the backend, but on the API, it doesn't check the attribute set of the product, only the the entity_type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CatalogComponent: Framework/WebapiUSE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just CatalogFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: 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 developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releasebug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions