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

Allow namespaced XML element discriminator #753

Merged
merged 5 commits into from
Apr 27, 2017
Merged

Allow namespaced XML element discriminator #753

merged 5 commits into from
Apr 27, 2017

Conversation

goetas
Copy link
Collaborator

@goetas goetas commented Apr 26, 2017

Allows to :

use JMS\Serializer\Annotation as Serializer;
/**
 * @Serializer\Discriminator(field = "type", map = {
 *    "tiger": "Ns\Tiger"
 * })
 * @Serializer\XmlDiscriminator(namespace="http://example.com/", cdata=false)
 * @Serializer\XmlNamespace(prefix="foo", uri="http://example.com/")
 */
class Animal
{

}


$serializer->serialize(new Tiger());
<result xmlns:foo="http://example.com/">
  <foo:type>tiger</foo:type>
</result>

@goetas goetas added this to the v1.8 milestone Apr 26, 2017
@goetas goetas merged commit 151e52e into master Apr 27, 2017
@goetas goetas deleted the xml-discr-ns branch April 27, 2017 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant