kunicmarko20/SonataAnnotationBundle

AddRoute documentation typo?

Xymanek opened this issue · 4 comments

 * @Sonata\AddRoute(name="import", path="/import")
 * @Sonata\AddRoute(name="send_mail", path="{id}/send_mail")

First begins with a slash, second doesn't. So what's the correct way?

I think that it should always work without the slash, will test it to be sure, also what do you think about allowing just:

 * @Sonata\AddRoute("import")
 * @Sonata\AddRoute(name="send_mail", path="{id}/send_mail")

and using import for name and path if path is not present?

It's ambiguous - is it global (/import) or per object (/{id}/import)?

Also would be nice to reduce the second line to just

 * @Sonata\AddRoute("send_mail", path="{id}/send_mail")

Well if it is per object you have to add {id}, will fix the docs and remove the name=.

It seems that it doesn't matter if you use / or no, fixed in 528aa1b. Thank you @Xymanek