I have a field that is of type: array. I am trying to save data in this field but the admin component keeps giving me a The type of the "acceptedMeasurements" attribute must be "array", "string" given. error (obviously from Symfony).
Here is the relevant code:
/**
* @ORM\Column(type="array", nullable=true)
*/
private $acceptedMeasurements;
/**
* @return null|array
*/
public function getAcceptedMeasurements(): ?array
{
return $this->acceptedMeasurements;
}
/**
* @param null|array $acceptedMeasurements
*
* @return Exercise
*/
public function setAcceptedMeasurements(?array $acceptedMeasurements): self
{
$this->acceptedMeasurements = $acceptedMeasurements;
return $this;
}
Swagger seems to have this correct:
{
"active": true,
"name": "string",
"user": "string",
"acceptedMeasurements": [
"string"
]
}
In admin, I have tried inputting:
[test]
['test']
["test"]
{"test"}
a:1:{i:0;s:4:"test";}
and probably a couple more but nothing works.
Can anyone help with how I am meant to save arrays?
array, react-admin gives me a text field to enter the value into. Nothing I type into this field works - Wildcard27react-admin. I will check when I have a little time and report back - Wildcard27