Skip to content

Cannot create a numeric value attribute option using the REST API #18009

Description

@sidm

Preconditions

Magento ver. 2.2.5 using the REST API.

Steps to reproduce

  1. Make a POST call to http://winninge.nextmp.net/rest/V1/products/attributes/<attribute_name>/options i.e., http://winninge.nextmp.net/rest/V1/products/attributes/Size/options setting the label and value to be a numeric string, for example
    { "option": { "label": "30", "value": "30", "sort_order": 0, "is_default": false, "store_labels": [{ "store_id": 0, "label": "30" }] } }

Expected result

  1. Attribute option to be created successfully with a 200 status code

Actual result

  1. The API responds with { "message": "Cannot save attribute %1", "parameters": ["size"] } and a 400 status code

This is happening when the attribute is a number, and a number alone. It also happens with floating point numbers, such as 6.5.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Component: CatalogFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed 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.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions