Skip to content

Circular reference with ParamConverter annotation #14337

Closed
@slavafomin

Description

@slavafomin

Hello!

I've encountered some weird issue when using ParamConverter in my Symfony 2 application (2.6.6).

I have the following controller:

    /**
     * @param User $user
     * @param Mailing $mailing
     *
     * @return array
     *
     * @REST\Get("/users/{id}/mailings/{mailingId}")
     * @REST\View
     *
     * @ParamConverter("mailing", options={"id" = "mailingId"})
     */
    public function getMailingForUserAction(User $user, Mailing $mailing)
    {
        return [];
    }

I'm getting the following exception:

FileLoaderImportCircularReferenceException in FileLoader.php line 97: Circular reference detected in "/vagrant/app/config/routing.yml" ("/vagrant/app/config/routing.yml" > "/vagrant/app/config/routing_api.yml" > "AppBundle\Controller\MailingsController" > "/vagrant/app/config/routing.yml").

The same problem is discussed here, with no answer, so it's not the isolated case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions