Skip to content

Route name generation is not working as before #5008

Description

@Cryde

API Platform version(s) affected: 2.7.0

Description
In previous version when I did a bin/console debug:router all the route generated by API Plateform had a generated name which I was able to use as reference in my project.
When upgrading to 2.7 it's not the case anymore.

Before :

 ----------------------------------------------- -------- -------- ------ ------------------------------------------------ 
  Name                                            Method   Scheme   Host   Path                                            
 ----------------------------------------------- -------- -------- ------ ------------------------------------------------                  
  api_comment_threads_get_item                    GET      ANY      ANY    /api/comment_threads/{id}.{_format}             
  api_comments_get_collection                     GET      ANY      ANY    /api/comments.{_format}                         
  api_comments_post_collection                    POST     ANY      ANY    /api/comments.{_format}                         
  api_comments_get_item                           GET      ANY      ANY    /api/comments/{id}.{_format}                    

After :

 ----------------------------------------------------------- -------- -------- ------ ------------------------------------------------ 
  Name                                                        Method   Scheme   Host   Path                                            
 ----------------------------------------------------------- -------- -------- ------ ------------------------------------------------                                  
  _api_/comments/{id}.{_format}_get                           GET      ANY      ANY    /api/comments/{id}.{_format}                    
  _api_/comments.{_format}_get_collection                     GET      ANY      ANY    /api/comments.{_format}                         
  _api_/comments.{_format}_post                               POST     ANY      ANY    /api/comments.{_format}                         
  _api_/comment_threads/{id}.{_format}_get                    GET      ANY      ANY    /api/comment_threads/{id}.{_format}             

How to reproduce
Have some entities in 2.6.8 then upgrade to 2.7.0
Run each time : bin/console debug:router

Possibile workaround
Add name property in each operations and name it as API plateform did before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions