Skip to content

Incorrect unmarshalling code for KalturaLiveStatsListResponse #1013

Description

@s-ordellnielsen-img

Description

The PHP client library generated from the current schema produces incorrect unmarshalling code for KalturaLiveStatsListResponse, causing all object properties to be NULL despite the API returning the correct data.

Cause

The schema definition for KalturaLiveStatsListResponse specifies objects as a single KalturaLiveStats object instead of an array. However, the API response returns an array of KalturaLiveStats objects. The client-generator produced code that attempts to unmarshal the array wrapper as a single object, rather than iterating through array items.

Generated code (incorrect)

// LiveStatsListResponse.php
if(count($xml->objects) && !empty($xml->objects))
    $this->objects = \Kaltura\Client\ParseUtils::unmarshalObject($xml->objects, "KalturaLiveStats");

Fix

The generated code should use unmarshalArray instead of unmarshalObject which solves the issue

// LiveStatsListResponse.php
if(count($xml->objects) && !empty($xml->objects))
    $this->objects = \Kaltura\Client\ParseUtils::unmarshalArray($xml->objects, "KalturaLiveStats");

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions