Skip to content

Issues with object serialization #8

@kangjianwei

Description

@kangjianwei

Serialization of null fields is enabled by default here, which means that null values will appear in the JSON output.

This causes a problem: for example, when creating a product, if you only fill in the src of the product image, the interface will throw an error indicating an invalid format for the image id. The reason is that the parameters passed to WooCommerce include {id: null}. In reality, however, the id field is optional and can be omitted. If we exclude null fields during serialization, WooCommerce will not report the error.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions