Skip to content

[PHP] "getFieldDeserializers() should return array..." with MERAKI.COM api #7830

Description

@WolfgangHG

Found as part of #7774:

Using the source code from 2026-06-17 and this command:

.\it\generate-code.ps1 -descriptionUrl https://raw.githubusercontent.com/meraki/openapi/refs/heads/master/openapi/spec3.json -language php -dev
.\it\exec-cmd.ps1 -descriptionUrl https://raw.githubusercontent.com/meraki/openapi/refs/heads/master/openapi/spec3.json -language php

The generated client does not compile:


 ------ ---------------------------------------------------------------------------------------------------------------
  Line   Client\Networks\Item\Clients\Item\SplashAuthorizationStatus\SplashAuthorizationStatusGetResponse_ssids.php
 ------ ---------------------------------------------------------------------------------------------------------------
  55     Method
         Integration\Test\Client\Networks\Item\Clients\Item\SplashAuthorizationStatus\SplashAuthorizationStatusGetResp
         onse_ssids::getFieldDeserializers() should return array<string, callable(Microsoft\Kiota\Abstractions\Seriali
         zation\ParseNode): void> but returns array{Closure(Microsoft\Kiota\Abstractions\Serialization\ParseNode): voi
         d}.
         🪪  return.type
 ------ ---------------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------------
  Line   Client\Networks\Item\Clients\Item\SplashAuthorizationStatus\SplashAuthorizationStatusPutResponse_ssids.php
 ------ ---------------------------------------------------------------------------------------------------------------
  55     Method
         Integration\Test\Client\Networks\Item\Clients\Item\SplashAuthorizationStatus\SplashAuthorizationStatusPutResp
         onse_ssids::getFieldDeserializers() should return array<string, callable(Microsoft\Kiota\Abstractions\Seriali
         zation\ParseNode): void> but returns array{Closure(Microsoft\Kiota\Abstractions\Serialization\ParseNode): voi
         d}.
         🪪  return.type
 ------ ---------------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------------
  Line   Client\Organizations\Item\ApiRequests\Overview\OverviewGetResponse_responseCodeCounts.php
 ------ ---------------------------------------------------------------------------------------------------------------
  290    Method
         Integration\Test\Client\Organizations\Item\ApiRequests\Overview\OverviewGetResponse_responseCodeCounts::getFi
         eldDeserializers() should return array<string, callable(Microsoft\Kiota\Abstractions\Serialization\ParseNode)
         : void> but returns non-empty-array<200|201|202|203|204|205|206|207|208|226|300|301|302|303|304|305|306|307|3
         08|400|401|402|403|404|405|406|407|408|409|410|411|412|413|414|415|416|417|421|422|423|424|425|426|428|429|43
         1|451|500, callable(): mixed>.
         🪪  return.type

The relevant snippet from "Client\Networks\Item\Clients\Item\SplashAuthorizationStatus\SplashAuthorizationStatusGetResponse_ssids.php" is:

/**
 * The deserialization information for the current model
 * @return array<string, callable(ParseNode): void>
*/
public function getFieldDeserializers(): array {
    $o = $this;
    return  [
        '0' => fn(ParseNode $n) => $o->setZero($n->getObjectValue([SplashAuthorizationStatusGetResponse_ssids_Zero::class, 'createFromDiscriminatorValue'])),
    ];
}

Snippet of the API description:

"/networks/{networkId}/clients/{clientId}/splashAuthorizationStatus": {
  "get": {
    "description": "Return the splash authorization for a client, for each SSID they've associated with through splash. Only enabled SSIDs with Click-through splash enabled will be included. Clients can be identified by a client key or either the MAC or IP depending on whether the network uses Track-by-IP.",
    "operationId": "getNetworkClientSplashAuthorizationStatus",
    "parameters": [
      ...
    ],
    "responses": {
      "200": {
        "description": "Successful operation",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "ssids": {
                  "type": "object",
                  "properties": {
                    "0": {
                      "type": "object",
                      "properties": {
                        "isAuthorized": {
                          "type": "boolean",
                          "description": "Whether the client is currently authorized on this SSID"
                        },
                        "authorizedAt": {
                          "type": "string",
                          "description": "When the client was authorized on this SSID in ISO 8601 format. This field will be null if the client is not currently authorized.",
                          "x-nullable": true
                        },
                        "expiresAt": {
                          "type": "string",
                          "description": "When the client's authorization on this SSID expires in ISO 8601 format. This field will be null if the client is not currently authorized or if there is no expiration time for the authorization.",
                          "x-nullable": true
                        }
                      },
                      "description": "Splash authorization for SSID 0"
                    }
                  },
                  "description": "A map of SSID number to the client's splash authorization status for that SSID. Only SSIDs that the client has connected to in the past will be included."
                }
              }
            },

Same for "SplashAuthorizationStatusPutResponse_ssids.php".

The relevant snippet from "Client\Organizations\Item\ApiRequests\Overview\OverviewGetResponse_responseCodeCounts.php" is:

/**
 * The deserialization information for the current model
 * @return array<string, callable(ParseNode): void>
*/
public function getFieldDeserializers(): array {
    $o = $this;
    return  [
        '500' => fn(ParseNode $n) => $o->setFiveZeroZero($n->getIntegerValue()),
        '451' => fn(ParseNode $n) => $o->setFourFiveOne($n->getIntegerValue()),
        '415' => fn(ParseNode $n) => $o->setFourOneFive($n->getIntegerValue()),
        '414' => fn(ParseNode $n) => $o->setFourOneFour($n->getIntegerValue()),
        ...
        '200' => fn(ParseNode $n) => $o->setTwoZeroZero($n->getIntegerValue()),
    ];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Needs Triage 🔍

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions