HubSpot / hubspot-api-php

HubSpot API PHP Client Libraries for V3 version of the API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wrong serialization of some properties

pieterdt opened this issue · comments

When fetching a blog post through the sdk api, and sending the output unmodified back in a create request results in validation errors.

At least layoutSections and widgetContainers, when empty, get serialized as arrays ([]) and trying to send it (with postman then) with {} in stead of [] works.

The json received for a blog post contains empty objects for those properties, but the serialized body that is sent through the sdk changes that into [].

Simply adding the JSON_FORCE_OBJECT into the serialization call does not solve the trick because attachedStylesheets requires an array.

How can I work around this issue?