-
Notifications
You must be signed in to change notification settings - Fork 118
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
[RFC] Simple Relation
with targetted-class
#163
Comments
FYI there is a The only reason I could see for |
I updated the sample, for sure the idea was also to remove the need of About the rel definition, I compare it to the columnName of Doctrine ORM: for sure it's configurable but based on the name of the attribute there's a default value, and it make it simple ! Another idea is that if the column already as Doctrine ORM annotation such has To finish, the |
So I think that allowing Regarding solving the link thing, it does not seem trivial. |
I disagree: if It's like impossible to solve the (I updated the first message) |
@adrienbrault @willdurand It that seems good for you ? Is a PR that implement this behaviour would be merged ? |
I think that the current usage of
Hateoas\Relation
annotation could be simplified. Right now we need to add each relations at the class-level.First of all, we sometime repeat the
href
link of an entity that is linked in two others for instance. We also must name the relation most of the time with the same name as the attribute's name: renaming could the optional.To solve these issues, what do you think to allow attribute-level usage of
Relation
annotation, and add antarget
attribute on it ?That way, entity defined in the documentation up to Embedding resources could be write:
To clarify the
self
relation, we could create anHateoas\Self
annotation. This could also reveal its usage by relations targeted to this entity.The
embedded
attribute value become a boolean value that simply defines if this relation have to be embedded or just linked. We could rely on the JMS SerializerAccessor
annotation to optionally use another getter.Note that for me (and it appears that for JMS Serializer too), the exclusion in case of null value is logical so I think that we could make it by default and provide a way to force null values with a
forceNull
attribute onHateoas\Exclusion
annotation.The text was updated successfully, but these errors were encountered: