Skip to content

Support deserializing [] as null or empty collection when the java type is a not an object  #540

@fabienrenaud

Description

@fabienrenaud

In PHP, it is possible to associate arrays. Those associates arrays can then be json encoded and turn to be JSON objects.
But when the associate array is empty, for various processing reasons, json_encode won't be able to tell that this particular empty associate array is an object, so it encodes it as [].
Then all hell breaks in Java because deserialize [] into a non array class doesn't work.

Task: Support that such as it deserialize to null when the java type is an non array object, and as empty collection when the java type is a collection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions