[QUESTION] Should a warning be raised when some routes can never be called ?
See original GitHub issueFirst check
- I added a very descriptive title to this issue.
- I used the GitHub search to find a similar issue and didn’t find it.
- I searched the FastAPI documentation, with the integrated search.
- I already searched in Google “How to X in FastAPI” and didn’t find any information.
- I already read and followed all the tutorial in the docs and didn’t find an answer.
- I already checked if it is not related to FastAPI but to Pydantic.
- I already checked if it is not related to FastAPI but to Swagger UI.
- I already checked if it is not related to FastAPI but to ReDoc.
- After submitting this, I commit to one of:
- Read open issues with questions until I find 2 issues where I can help someone and add a comment to help there.
- I already hit the “watch” button in this repository to receive notifications and I commit to help at least 2 people that ask questions in the future.
- Implement a Pull Request for a confirmed bug.
Example
Here’s a self-contained, minimal, reproducible, example with my use case:
from fastapi import FastAPI
app = FastAPI()
@app.get("/user/{user}")
def read_user():
return {"Hello": "World"}
@app.get("/user/me}")
def read_user_me():
return {"Hello": "World": }
Description
According to https://fastapi.tiangolo.com/tutorial/path-params/?h=+order#order-matters the order of the routes matters. Ideally it’s a better practice to pay attention to the order, but one can sometimes make mistakes. In my example, the route /user/me will never be called.
It could maybe be interesting to raise a warning (or an Error?) to inform the user of this.
Environment
-
OS: Windows
-
FastAPI Version 0.60.0
-
Python version: 3.8
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Matched leaf route at location "/" does not have an element
Matched leaf route at location "/MyGames" does not have an element. This means it will render an <Outlet /> with a null value...
Read more >SAMPLE – Written Warning for Attendance
The purpose of this letter is to emphasize the seriousness of your attendance record (absenteeism) as a. [classification] with the [agency/department name] ...
Read more >988 Frequently Asked Questions - SAMHSA
FAQs About Call Routing, Privacy, Network Functioning · What will be in place to protect data privacy of users of 988? · Will...
Read more >Emergency Exit Routes
Knowing the answers to these questions could keep you safe during an emergency. What is an exit route? An exit route is a...
Read more >Disciplinary procedures | nidirect
Employers use disciplinary procedures to tell employees that their performance or conduct isn't up to the expected standard and to encourage improvement.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Totally right ! Thx @ycd , closing the issue 😃
Thanks for the help here @ycd ! 👏 🙇
Thanks for reporting back and closing the issue @Tyrannas 👍