Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

inline array with type array<K, V> not serialized #784

Closed
aviortm opened this issue Jun 7, 2017 · 1 comment
Closed

inline array with type array<K, V> not serialized #784

aviortm opened this issue Jun 7, 2017 · 1 comment

Comments

@aviortm
Copy link
Contributor

aviortm commented Jun 7, 2017

Example object:

<?php

namespace JMS\Serializer\Tests\Fixtures;

use JMS\Serializer\Annotation as Serializer;

final class ObjectWithInlineArray
{
    /**
     * @Serializer\Inline()
     * @Serializer\Type("array<string,string>")
     */
    public $array;

    /**
     * @param array $array
     */
    public function __construct(array $array)
    {
        $this->array = $array;
    }
}

Example Code

$object = new ObjectWithInlineArray(['a' => 'b', 'c' => 'd']);
echo($serializer->serialize($object))

Result

actual:
{}
expected:
{"a":"b","c":"d"}
aviortm added a commit to aviortm/serializer that referenced this issue Jun 7, 2017
aviortm added a commit to aviortm/serializer that referenced this issue Jun 7, 2017
aviortm added a commit to aviortm/serializer that referenced this issue Jun 7, 2017
goetas added a commit that referenced this issue Jun 17, 2017
#784 fix with inline array of type array<K, V>
@goetas
Copy link
Collaborator

goetas commented Jun 23, 2017

fixed with #785

@goetas goetas closed this as completed Jun 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants