Skip to main content
Tweeted twitter.com/StackMagento/status/879970653520134145
edited title
Link
Rakesh Jesadiya
  • 42.4k
  • 19
  • 132
  • 184

Magento 2 - "Property \"Slider\" does not have corresponding setter in class \"Magento\\Eav\\Api\\Data\\AttributeOptionInterface\""Magento\\Eav\\Api\\Data\\AttributeOptionInterface\"."

deleted 23 characters in body
Source Link
Rakesh Jesadiya
  • 42.4k
  • 19
  • 132
  • 184

I am trying to override Magento\Eav\Api\Data\AttributeOptionInterface in my custom module. I want to add one new option to existing interface.

The idea behind is, As of now we can only pass defined options data in attribute options REST API

See below API request format for more clarity.

Api

Url = http://test.com/index.php/rest/V1/products/attributes/manufacturer/options/
Api Methodd - Post
Api body - {
  "option": {
    "label": "test",
    "is_default": "true",
  }
}

As of now its passing 3 parameters as value, I want to add my custom 4th parameters Ex - Slider.

So parameters should be

{
  "option": {
    "label": "test",
    "is_default": "true",
    "slider":"test1"
  }
}

I have tried to override interface and its method but its giving property setter not defined

Error Message

"message": "Property \"Slider\" does not have corresponding setter in class \"Magento\\Eav\\Api\\Data\\AttributeOptionInterface\"."

So here my question is how can I override API interface and pass my custom or add my option in existing parameters.

your help will be appreciatedThanks.

I am trying to override Magento\Eav\Api\Data\AttributeOptionInterface in my custom module. I want to add one new option to existing interface.

The idea behind is, As of now we can only pass defined options data in attribute options REST API

See below API request format for more clarity.

Api

Url = http://test.com/index.php/rest/V1/products/attributes/manufacturer/options/
Api Methodd - Post
Api body - {
  "option": {
    "label": "test",
    "is_default": "true",
  }
}

As of now its passing 3 parameters as value, I want to add my custom 4th parameters Ex - Slider.

So parameters should be

{
  "option": {
    "label": "test",
    "is_default": "true",
    "slider":"test1"
  }
}

I have tried to override interface and its method but its giving property setter not defined

Error Message

"message": "Property \"Slider\" does not have corresponding setter in class \"Magento\\Eav\\Api\\Data\\AttributeOptionInterface\"."

So here my question is how can I override API interface and pass my custom or add my option in existing parameters.

your help will be appreciated.

I am trying to override Magento\Eav\Api\Data\AttributeOptionInterface in my custom module. I want to add one new option to existing interface.

The idea behind is, As of now we can only pass defined options data in attribute options REST API

See below API request format for more clarity.

Api

Url = http://test.com/index.php/rest/V1/products/attributes/manufacturer/options/
Api Methodd - Post
Api body - {
  "option": {
    "label": "test",
    "is_default": "true",
  }
}

As of now its passing 3 parameters as value, I want to add my custom 4th parameters Ex - Slider.

So parameters should be

{
  "option": {
    "label": "test",
    "is_default": "true",
    "slider":"test1"
  }
}

I have tried to override interface and its method but its giving property setter not defined

Error Message

"message": "Property \"Slider\" does not have corresponding setter in class \"Magento\\Eav\\Api\\Data\\AttributeOptionInterface\"."

So here my question is how can I override API interface and pass my custom or add my option in existing parameters.

Thanks.

deleted 28 characters in body
Source Link
Rakesh Jesadiya
  • 42.4k
  • 19
  • 132
  • 184

I am trying to override Magento\Eav\Api\Data\AttributeOptionInterface in my custom module. I want to add one new option to existing interface.

The idea behind is, As of now we can only pass defined options data in attribute options REST API

See below API request format for more clarity.

Api

Url = http://test.com/index.php/rest/V1/products/attributes/manufacturer/options/
Api Methodd - Post
Api body - {
  "option": {
    "label": "test",
    "is_default": "true",
  }
}

As of now its passing 3 parameters as value, I want to add my custom 4th parameters Ex - Slider.

So parameters should be

{
  "option": {
    "label": "test",
    "is_default": "true",
    "slider":"test1"
  }
}

I have tried to override interface and its method but its giving property setter not defined

Error Message

"message": "Property \"Slider\" does not have corresponding setter in class \"Magento\\Eav\\Api\\Data\\AttributeOptionInterface\"."

So here my question is how can I override API interface and pass my custom or add my option in existing parameters.

Hope it makes sense, your help will be appreciated. Thanks.

I am trying to override Magento\Eav\Api\Data\AttributeOptionInterface in my custom module. I want to add one new option to existing interface.

The idea behind is, As of now we can only pass defined options data in attribute options REST API

See below API request format for more clarity.

Api

Url = http://test.com/index.php/rest/V1/products/attributes/manufacturer/options/
Api Methodd - Post
Api body - {
  "option": {
    "label": "test",
    "is_default": "true",
  }
}

As of now its passing 3 parameters as value, I want to add my custom 4th parameters Ex - Slider.

So parameters should be

{
  "option": {
    "label": "test",
    "is_default": "true",
    "slider":"test1"
  }
}

I have tried to override interface and its method but its giving property setter not defined

Error Message

"message": "Property \"Slider\" does not have corresponding setter in class \"Magento\\Eav\\Api\\Data\\AttributeOptionInterface\"."

So here my question is how can I override API interface and pass my custom or add my option in existing parameters.

Hope it makes sense, your help will be appreciated. Thanks.

I am trying to override Magento\Eav\Api\Data\AttributeOptionInterface in my custom module. I want to add one new option to existing interface.

The idea behind is, As of now we can only pass defined options data in attribute options REST API

See below API request format for more clarity.

Api

Url = http://test.com/index.php/rest/V1/products/attributes/manufacturer/options/
Api Methodd - Post
Api body - {
  "option": {
    "label": "test",
    "is_default": "true",
  }
}

As of now its passing 3 parameters as value, I want to add my custom 4th parameters Ex - Slider.

So parameters should be

{
  "option": {
    "label": "test",
    "is_default": "true",
    "slider":"test1"
  }
}

I have tried to override interface and its method but its giving property setter not defined

Error Message

"message": "Property \"Slider\" does not have corresponding setter in class \"Magento\\Eav\\Api\\Data\\AttributeOptionInterface\"."

So here my question is how can I override API interface and pass my custom or add my option in existing parameters.

your help will be appreciated.

edited title
Link
Rakesh Jesadiya
  • 42.4k
  • 19
  • 132
  • 184
Loading
added 9 characters in body
Source Link
Rakesh Jesadiya
  • 42.4k
  • 19
  • 132
  • 184
Loading
added 163 characters in body
Source Link
Rakesh Jesadiya
  • 42.4k
  • 19
  • 132
  • 184
Loading
edited body
Source Link
Rakesh Jesadiya
  • 42.4k
  • 19
  • 132
  • 184
Loading
changes in body information
Source Link
Manthan Dave
  • 9.9k
  • 2
  • 33
  • 54
Loading
Source Link
Rakesh Jesadiya
  • 42.4k
  • 19
  • 132
  • 184
Loading