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

Maybe the serializer should also allow the legal literals {1, 0} for booleans #198

Closed
slopjong opened this issue Dec 4, 2013 · 1 comment

Comments

@slopjong
Copy link

slopjong commented Dec 4, 2013

SimpleXML is using 1 and 0 for booleans but the JMS serializer doesn't accept these literals. Is there a reason why only the canonical representation is supported?

...
$dom = new \SimpleXMLElement($xml);
$dom->aboolean = true;
$xml = $dom->saveXML();
...

// an instance of the JMS serializer
$deserializer->deserialize($xml, 'My\Model');
 JMS\Serializer\Exception\RuntimeException
 Could not convert data to boolean. Expected "true", or "false", but got "1".
@goetas
Copy link
Collaborator

goetas commented Aug 21, 2016

#302

@goetas goetas closed this as completed Aug 21, 2016
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