LINK annotation #283

Closed
mixegen opened this Issue Aug 23, 2012 · 7 comments

Projects

None yet

5 participants

mixegen commented Aug 23, 2012

I wonder maybe it is possible to add Link annotation to basic set. For example, if I want to use LINK method I can configure route through yml, but not through annotation. It's will be useful to use something like @Route\Link. I'm talking about this kind of usage - http://williamdurand.fr/2012/08/02/rest-apis-with-symfony2-the-right-way/#the_friendship_algorithm

Owner

Ship it :)

Owner
stof commented Aug 23, 2012

you can already, as there is a generic @Rest\Route() allowing to set any method (the other ones are just shortcuts for it setting the _method requirement) :)

mixegen commented Aug 23, 2012

But I c this in Route annotation class:

public function __construct(array $data)
    {
        parent::__construct($data);
        $requirements = $this->getRequirements();
        $requirements['_method'] = $this->getMethod();
        $this->setRequirements($requirements);
    }

    public function getMethod()
    {
        return null;
    }

So, as I understand, no matter which method I set it Route(...) requirements parameter it will ignore it. And as result I will get route with GET method required or I missed something...

Owner
stof commented Aug 23, 2012

arf, indeed.

Hmm, this also means it is impossible to allow several methods for a route (except by allowing all of them). this looks bad.

@everzet everzet was assigned Aug 23, 2012
Owner

hmm .. i am not sure about the intention of that class .. @everzet was it intended to be abstract?

Owner
everzet commented Aug 24, 2012

@lsmith77 yup, it should've been abstract.

Owner
lsmith77 commented Nov 8, 2012

see #288

@lsmith77 lsmith77 closed this Nov 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment