'The type of the key must be "int", "string" given. While testing
I'm writing some tests but in \Symfony\Bundle\FrameworkBundle\Test\WebTestCase, static::createClient()->xmlHttpRequest() convert everything to string while sending the request. I'm testing an api using Api-platform. The api-platform\\core\\src\\Serializer\\AbstractItemNormalizer.php expect the value to be an int but in the test Symfony is sending the json int a string.
I even extend ApiPlatform\Core\Bridge\Symfony\Bundle\Test\ApiTestCase and use static::createClient()->request(...["json"=[...]]) and it is giving me the same error.
How can I force api-plaform to cast the string to int or how can I force Symfony to send the int instead of a string?
Making curl request works, but I'm using test environment. So when I make the curl request it points to the dev environment.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
