TheFootballSocialClub/FSCHateoasBundle — pull request #22 by jstout24 (2012-12-10 23:18:58+00:00)
Title: Added support for non-required relations (fixes #21)

This simply omits the link completely an Symfony\Component\Form\Exception\UnexpectedTypeException is thrown.

In other words, if I have the following config:

```yml
FSC\HateoasBundle\Tests\Fixtures\User:
relations:
- rel: best_friend
href:
route: _some_route
parameters:
id: bestFriend.id
required: false
```

if bestFriend.id does not exist in the User object (meaning null in most cases), then we'd omit the best_friend link completely.

I feel this is less of a hack then doing this manually or creating subscribers for every single object that may need this... Maybe even eventually hooking into the objects validation and seeing what fields are required and taking that value from there by default (since that's what most people would want anyway)