src/API/ModelController.php
private function getContentFromRequest(Request $request): array
    {
        $data = json_decode($request->getContent(), true);
        foreach ($data as $key => $value) {
            if ($value === null || $value === '') {
                unset($data[$key]);
            }
        }
        return $data;
    }
private function getContentFromRequest(Request $request): array
    {
        $data = json_decode($request->getContent(), true);
        foreach ($data as $key => $value) {
            if ($value === null || $value === '') {
                unset($data[$key]);
            }
        }
        return $data;
    }
private function getContentFromRequest ( Request $ request ) : array { $ data = json_decode ( $ request -> getContent ( ) , true ) ; foreach ( $ data as $ key => $ value ) { if ( $ value === null || $ value === '' ) { unset ( $ data [ $ key ] ) ; } } return $ data ; }
Returns an array of data from the request body and omits null values.

@param Request $request
@return array
Returns an array of data from the request body and omits null values .