[Bug]: POST /api/v1/rest/attributes/{code}/options throws TypeError: setLabels() Argument #1 must be of type array, string given
Pre-submission checklist
- I have searched the existing issues and this bug has not already been reported.
UnoPim Version(s) affected
2.1.6
Issue Description
When creating a new attribute option via the REST API, the request fails with a 500 Internal Server Error.
Preconditions (environment)
self-hosted Docker deployment, UnoPim (latest as of July 2026), Laravel 12.
Steps to reproduce
Authenticate via POST /oauth/token (password grant) — succeeds, returns valid token Confirm existing options via GET /api/v1/rest/attributes/brand/options — succeeds, returns e.g.:
json [{"code": "kazoo", "sort_order": 1, "labels": {"en_AU": "Kazoo"}}]
Attempt to create a new option via POST /api/v1/rest/attributes/brand/options with body:
json {"code": "bainbridge", "labels": {"en_AU": "Bainbridge"}}
Receive 500 Internal Server Error
Expected Result
the option is created, matching the shape returned by the GET endpoint.
Actual Result
Webkul\AdminApi\Http\Controllers\API\ApiController::setLabels(): Argument #1 ($requestData) must be of type array, string given, called in /var/www/html/packages/Webkul/AdminApi/src/Http/Controllers/API/Catalog/AttributeController.php on line 178
Screenshots
No response
Additional Context
No response
Source: unopim/unopim