Anteris-Dev / autotask-client

An HTTP client for the Autotask API built with PHP.
MIT License
23 stars 16 forks source link

Invalid type: expected ConfigurationItemCategoryEntity::displayColorRgb to be of type `integer`, instead got value `null`, which is NULL.. #58

Open PeterVoskuilen opened 2 years ago

PeterVoskuilen commented 2 years ago

Get an error when getting ConfigurationItemCategory fro AutoTask

Invalid type: expected Anteris\Autotask\API\ConfigurationItemCategories\ConfigurationItemCategoryEntity::displayColorRgb to be of type integer, instead got value null, which is NULL..

ConfigurationItemCategories does have RGB value in Autotask as seen in image. although it might be blue because thats a default and value is NULL.

image

Second error: Public properties displayColorRGB not found on Anteris\Autotask\API\ConfigurationItemCategories\ConfigurationItemCategoryEntity

Resolved by changing line 13 in ConfigurationItemCategoryEntity public int $displayColorRGB;

aidan-casey commented 2 years ago

@PeterVoskuilen - Are you saying you resolved by changing line 13 to:

public ?int $displayColorRGB;?

Rodeveer commented 2 years ago

@aidan-casey I've also encountered this problem The value can be null from autotask. I've changed it to that and that should be the solution. I'll try to make a PR this evening and will assign you to it for check-up!

tux2442 commented 1 year ago

80 should fix this bug.

NfickettAIS commented 8 months ago

@PeterVoskuilen - Are you saying you resolved by changing line 13 to:

public ?int $displayColorRGB;?

This is how I was able to resolve the issue on my end, with that specific field, and others. Is there, by chance, any plans on implementing more "null" handling? I have had to make changes to 9 or so models to resolve an error caused by receiving null from Autotask.