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

Why do we need this check inside SerializedName constructor, if there is name? #558

Closed
idchlife opened this issue Mar 3, 2016 · 2 comments
Milestone

Comments

@idchlife
Copy link

idchlife commented Mar 3, 2016

I encountered this part when using PhpStorm with PHP Annotations plugin, when I wrote name="my_preferred_name" and got error "value" key undefined after opening my app.

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

So, if there is public property $name, why is there value? How about PR for this thing, whatcha guys think if I manage one?

@scaytrase
Copy link
Contributor

This check is needed when writing things like @SerializedName("the_property_name"). But of course, this should check, whether the 'value' key exist in this case.

@goetas goetas added this to the v1.7 milestone Apr 4, 2017
@goetas goetas closed this as completed in fb93c72 Apr 11, 2017
@goetas goetas modified the milestone: v1.7 Apr 11, 2017
@goetas
Copy link
Collaborator

goetas commented Apr 11, 2017

This is ment to make obligatory the first parameter of the anotation

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