Home
DevCentral
Search
Configure Global Search
Log In
Transactions
T1734
Change Details
Change Details
Old
New
Diff
``` [24-Apr-2019 18:40:09 UTC] PHP Fatal error: Uncaught InvalidArgumentException: JsonMapper::map() requires first argument to be an object, NULL given. in /srv/api/servers-log/vendor/netresearch/jsonmapper/src/JsonMapper.php:126 Stack trace: #0 /srv/api/servers-log/src/LogEntry.php(43): JsonMapper->map(NULL, Object(Nasqueron\Api\ServersLog\LogEntry)) #1 /srv/api/servers-log/src/Service.php(42): Nasqueron\Api\ServersLog\LogEntry::fromJSON(NULL) #2 /srv/api/servers-log/src/Service.php(33): Nasqueron\Api\ServersLog\Service->put(NULL) #3 /srv/api/servers-log/src/public/index.php(19): Nasqueron\Api\ServersLog\Service->handle() #4 {main} ``` Not sure if it's still up to date, but composer.json of rAPISRVLOGS still refer to `"netresearch/jsonmapper": "^1.1.1"` and we're at 4.0.0.
``` [24-Apr-2019 18:40:09 UTC] PHP Fatal error: Uncaught InvalidArgumentException: JsonMapper::map() requires first argument to be an object, NULL given. in /srv/api/servers-log/vendor/netresearch/jsonmapper/src/JsonMapper.php:126 Stack trace: #0 /srv/api/servers-log/src/LogEntry.php(43): JsonMapper->map(NULL, Object(Nasqueron\Api\ServersLog\LogEntry)) #1 /srv/api/servers-log/src/Service.php(42): Nasqueron\Api\ServersLog\LogEntry::fromJSON(NULL) #2 /srv/api/servers-log/src/Service.php(33): Nasqueron\Api\ServersLog\Service->put(NULL) #3 /srv/api/servers-log/src/public/index.php(19): Nasqueron\Api\ServersLog\Service->handle() #4 {main} ``` An old stacktrace, that's the last error of the log, so we've probably a better code client side, but still, the NULL value isn't handled by Service::put(). When calling the service with a PUT request, it's expected we've a json payload, or we should gracefully fail and serve an HTTP 400 error.
``` [24-Apr-2019 18:40:09 UTC] PHP Fatal error: Uncaught InvalidArgumentException: JsonMapper::map() requires first argument to be an object, NULL given. in /srv/api/servers-log/vendor/netresearch/jsonmapper/src/JsonMapper.php:126 Stack trace: #0 /srv/api/servers-log/src/LogEntry.php(43): JsonMapper->map(NULL, Object(Nasqueron\Api\ServersLog\LogEntry)) #1 /srv/api/servers-log/src/Service.php(42): Nasqueron\Api\ServersLog\LogEntry::fromJSON(NULL) #2 /srv/api/servers-log/src/Service.php(33): Nasqueron\Api\ServersLog\Service->put(NULL) #3 /srv/api/servers-log/src/public/index.php(19): Nasqueron\Api\ServersLog\Service->handle() #4 {main} ```
Not sure if it's still up to date
An old stacktrace, that's the last error of the log, so we've probably a better code client side, but still
,
but composer.json of rAPISRVLOGS still refer to `"netresearch/jsonmapper": "^1.1.1"` and we're at 4.0.0
the NULL value isn't handled by Service::put(). When calling the service with a PUT request, it's expected we've a json payload, or we should gracefully fail and serve an HTTP 400 error
.
Continue