Skip to content

Partial pattern matching #1594

@ImSingee

Description

@ImSingee

What is the problem this feature would solve?

Currently, we have two response formats for one API: xml and json:

POST /api/xxx.json
POST /api/xxx.xml

I want to register something like this:

/api/user/:id.json
/api/user/:id.xml

But it fails - currently, elysia see id.json and id.xml as param name, so what I want doesn't work.

What is the feature you are proposing to solve the problem?

Allow a "partial matching": /api/user/:id.json matches a request starts with /api/user/ and ends with .json, then use the middle thing as id param.

What alternatives have you considered?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions