Skip to content

Nested URL Mappings reverses ids #10246

@stlcubsfan

Description

@stlcubsfan

Given the following URL mapping:

        group("/api") {
            "/customer-stores"(resources: 'store') {
                "/catalogs"(controller: 'catalog', action: 'index', method: 'GET')
                "/catalogs/$catalogId/items"(controller: 'catalog', action: 'getItems', method: 'GET')
            }
        }

The output of url-mapping-report shows that the parameters specified get flipped. Notice catalogId should be after catalogs and storeId should be after customer-stores in the first route listed:

Controller: catalog
 |   GET    | /api/customer-stores/${catalogId}/catalogs/${storeId}/items      | Action: getItems                  |
 |   GET    | /api/customer-stores/${storeId}/catalogs                         | Action: index                     |
  • Operating System: Mac OS X
  • Grails Version: 3.1.8
  • JDK Version: 1.8

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions