Skip to content

✨ Add clear error message for missing route tags in app/main.py#2244

Open
rxxbyy wants to merge 1 commit into
fastapi:masterfrom
rxxbyy:fix/route-tag-validation
Open

✨ Add clear error message for missing route tags in app/main.py#2244
rxxbyy wants to merge 1 commit into
fastapi:masterfrom
rxxbyy:fix/route-tag-validation

Conversation

@rxxbyy
Copy link
Copy Markdown

@rxxbyy rxxbyy commented Mar 25, 2026

Added a guard statement with a clear error message when a route is missing tags.

Currently, when you miss setting up a tag you get an error like:

return f"{route.tags[0]}-{route.name}"
          ~~~~~~~~~~^^^
IndexError: list index out of range

With the proposed changes, the developer sees:

ValueError: Route 'my_new_route' is missing a tag. Each route must have at least one tag for client generation.

I believe this improves developer experience and saves debugging time for anyone using the template.
Thank you!

@YuriiMotov YuriiMotov changed the title 📝 Add clear error message for missing route tags in app/main.py. ✨ Add clear error message for missing route tags in app/main.py May 21, 2026
@YuriiMotov YuriiMotov added the feature New feature or request label May 21, 2026
Copy link
Copy Markdown
Member

@YuriiMotov YuriiMotov left a comment

Choose a reason for hiding this comment

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

Makes sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants