FSCHateoasBundle configuration in yaml

280 views Asked by At

I'm trying to use FSCHateoasBundle to add links to my API output.

The documentation mentions the possibility to configure relations using annotations or yaml but I cannot figure out where to place the yaml configuration and how it should be structured. Annotations as documented work fine. Has anyone an example?

What I try to do is to add a "relations" section in the configuration-files that are used by JMSSerializer. Do I have to use separate config-files for FSCHateoasBundle?

1

There are 1 answers

0
AdrienBrault On BEST ANSWER

The FSCHateoasBundle yaml configuration has to be done in another file than the JMSSerializerBundle.

To add metadata to your Acme\FooBundle\Entity\User with the JMSSerializerBundle, you'd create a file in src/Acme/FooBundle/Resources/config/serializer/Entity.User.yml.

With the FSCHateoasBundle, the file would be src/Acme/FooBundle/Resources/config/hateoas/Entity.User.yml.

I'll add a note in the readme ;-)