Skip to content

Static routing collision. #91

@husio

Description

@husio

Hi,

I have two endpoints - one of them return entity for given group in specified version, while the other returns the latest entity for given group. Routing should look like this:

router.GET("/:group_id/latest", redirectToLatest)
router.GET("/:group_id/:version_id", entityDetails)

Right now it's no possible. Definition order does not matter.

panic: path segment 'latest' conflicts with existing wildcard ':version_id' in path '/:group_id/latest' [recovered]   panic: path segment 'latest' conflicts with existing wildcard ':version_id' in path '/:group_id/latest'

I could check in entityDetails if version_id is latest and that's what I do right now, but it would be way nicer to allow to define static route, even if dynamic one already cover the same case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions