Skip to content

Custom normalizer not working in sub-entity #593

Description

@polc

Hello,

So for using the MisdPhoneNumberBundle I have wrote a custom normalizer (https://gist.github.com/polc/8e6ce48e9dcb33a36e9c5a632e80ed10).

Everything is working fine when I have just one entity: https://gist.github.com/polc/73b1c9f47c68682880714185b1ce1a57

When I do POST /entities

{
    "mobilePhone": "0620202020"
}

Then I get

{
    "@context": "/contexts/Entity",
    "@id": "/entities/1",
    "@type": "Entity",
    "mobilePhone": "+33623025411"
}

But when I use phone_number type in a sub entity : https://gist.github.com/polc/a69ee44024be9f4789d3773eb3ee1e89

When I do POST /entities

{
    "address": {
        "mobilePhone": "0620202020"
    }
}

I got Expected argument of type \"libphonenumber\\PhoneNumber\", \"string\" given

Note that Common\Address isn't a resource, just an entity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions