Skip to content

Conversation

@uriyyo
Copy link
Contributor

@uriyyo uriyyo commented May 4, 2021

Raise ValueError with information about duplicated names instead of sre_constants.error.

For instance:

app = Starlette(
    routes=[
        Route("/api/users/{id}/groups/{id}", route),
    ]
)

Will raise:

ValueError: Duplicated param name id at path /api/users/{id}/groups/{id}

Instead of:

sre_constants.error: redefinition of group name 'id' as group 2; was group 1 at position 42

Copy link
Contributor

@lovelydinosaur lovelydinosaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nicely done. 👍

@lovelydinosaur lovelydinosaur merged commit b7aeae7 into Kludex:master May 4, 2021
@uriyyo uriyyo deleted the feature/duplicated-names branch November 16, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants