Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Serialize null in positional arrays #572

Closed

Conversation

scaytrase
Copy link
Contributor

Fix #571

@scaytrase
Copy link
Contributor Author

I'm ready to fix some related tests but I'm not sure which failures belong to the patch as the whole build history is red
https://travis-ci.org/schmittjoh/serializer/builds

@maennchen
Copy link

maennchen commented May 7, 2016

@scaytrase You can now rebase on the original master and everything should get green.

@scaytrase scaytrase force-pushed the bugfix/null-in-valued-arrays branch from b87a7e5 to 0c06e6d Compare May 7, 2016 06:44
@scaytrase
Copy link
Contributor Author

Thanks, all green.

@scaytrase
Copy link
Contributor Author

scaytrase commented May 23, 2016

The given commit actually does not resolve the problem.

It fails a simple test

    public function testNullArraySerialization()
    {
        $context = SerializationContext::create();
        $context->setSerializeNull(true);
        $array = [0, null, 'a'];
        self::assertSame($array, $this->serializer->toArray($array, $context));
    }

How we force an array being normalized as array, not object?

Failed asserting that Array &0 (
    0 => 0
    2 => 'a'
) is identical to Array &0 (
    0 => 0
    1 => null
    2 => 'a'
).

@scaytrase scaytrase deleted the bugfix/null-in-valued-arrays branch May 19, 2017 20:52
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants