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

SerializedName misleading usage and constructor issue #548

Closed
enachesilviu opened this issue Jan 20, 2016 · 2 comments
Closed

SerializedName misleading usage and constructor issue #548

enachesilviu opened this issue Jan 20, 2016 · 2 comments

Comments

@enachesilviu
Copy link

It's about these lines: https://github.com/schmittjoh/serializer/blob/master/src/JMS/Serializer/Annotation/SerializedName.php#L33

https://github.com/schmittjoh/serializer/blob/master/src/JMS/Serializer/Annotation/SerializedName.php#L37

As far as I know it's common practice that annotation classes used with implementations of Doctrine\Common\Annotations\Reader to have property names and (if any) accessor/mutators names equivalent to property names you specify on a DocBlock line. For instance, I expect this to work: @Serializer\SerializedName(name="releaseType"). But it Instead I have to use @Serializer\SerializedName(value="releaseType") for it to work which doesn't make much sense following common practice. I believe popular editors follow common practice so they give you autocomplete on "name" field.

So I specified the "name" property in the DockBlock line and I stumbled across this using FOSElasticaBundle fos:elastica:populate command. I got this exception:

[Symfony\Component\Debug\Exception\ContextErrorException]
Notice: Undefined index: value

@Nezahual
Copy link

+1

@goetas
Copy link
Collaborator

goetas commented Apr 24, 2017

partially solved with fb93c72

regarding name vs value, I do not see differences

@goetas goetas closed this as completed Apr 24, 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

3 participants