New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

anyAttribute support in routing.xsd #27408

vbartusevicius opened this Issue May 29, 2018 · 1 comment


None yet
3 participants

vbartusevicius commented May 29, 2018

Currenty it is practically impossible to extend routing.xml due to restrictions in routing.xsd


<routes xmlns=""
    <route id="my_bundle.route_name" path="/category/{categoryId}">
        <default key="_controller">my_bundle.controller.category:someMethod</default>
       <vnd:my-attribute>something here</psr:api>

Imagine we want to define custom logic how categoryId is mapped to Entity or how other things related to Request/Response are handled here. Allowing anyAttribute here would allow developers to recongize and configure some advanced logic they want without braking current functionality.

Currently developers are finding ways how to work-around this, in example:

  • FOSJsRoutingBundle uses <option key="expose">true</option> to mark route available in Javascript;
  • FOSRestBundle uses type: rest to mark resource as rest

Doctrine has this in their doctrine-mapping.xml: - allows any attribute and any property.

I could provide PR to routing.xsd if this feature would be considered as useful.


This comment has been minimized.


nicolas-grekas commented Jun 5, 2018

What would be the downside of doing this? e.g. could it make it harder to spot some mistakes?
Feel free to provide a PR of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment