Skip to content

Make part of the path optional, including a string and param  #106

@tharakawj

Description

@tharakawj

I have set of filters in my path like this.

/goods/size/:s/brand/:b/color/:c

Now I want to make some of these filters optional so that I will be able to match all of the following paths.

/goods
/goods/size/large
/goods/size/large/brand/abc/color/red
/goods/brand/abc
/goods/size/medium/color/green

How can I do something like that? I'm expecting to have something like this.

/goods(/size/:s)?(/brand/:b)?(/color/:c)?

But seems it's not working.

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