-
Notifications
You must be signed in to change notification settings - Fork 4
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
@Attribute name annotation giving NULL when the class parameter name is different #13
Comments
This is still happening in the lastest version. |
@rubiodamian Can you copy the class you are using ? thanks |
Yes, sorry! /**
* Agentes
* @Rest\Entity(key="agentes")
*/
class Agentes
{
/**
* @Rest\Id
* @Rest\Attribute(name="@id", type="string")
*/
private $iri;
/**
* @var integer
*
* @Rest\Attribute(name="id", type="string")
*/
private $codigo;
/**
* @var integer
*
* @Rest\Attribute(name="legajo", type="integer")
*/
private $legajo;
/**
* @var array
*
* @Rest\Attribute(name="tipoCuil", type="array")
*/
private $tipo_cuil; the api responds with tipoCuil (array) |
Ok it's probably due to the fact that it's an array (the code is pretty ugly for arrays, because it can be a relation or an array), I will try to look at it tomorrow |
@rubiodamian Do you think it's related to #75 or not ? |
Maybe it is related because it's in the same part of code i think |
Can you see if the bug is still present in the 0.29.0 ? |
bug fixed!! 👍 |
Great, I'm closing this |
First of all let me define my resouces.
I use this Hydra API: http://www.markus-lanthaler.com/hydra/event-api/events/41
I created a class
Event
like:Now when I try to get the Event Entity the Id is correct. But the
$firstName
attribute gives me backNULL
.When I change the
$firstName
attribute to$name
, everything works like a charm.It looks like the @Attribute name annotation doesn't seem to work as it should.
The text was updated successfully, but these errors were encountered: