-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
Description
Motivation
When working on Flask applications with many API endpoints, it is sometimes
useful to quickly check whether all registered routes can be accessed without
raising unexpected errors (e.g. unhandled exceptions, 500 errors).
At the moment, developers typically need to write custom scripts or tests to
perform this kind of basic validation. Providing an opt-in CLI command could
help improve developer experience, especially during local development.
Proposal
Introduce an optional Flask CLI command (for example, flask check-endpoints)
that iterates over registered routes and makes test requests using Flask’s
test client.
The goal would not be full correctness testing, but a lightweight sanity check
to detect obvious runtime errors.
Possible initial scope:
- Only routes with simple methods (e.g. GET by default)
- Skip routes with required path parameters
- Report endpoints that raise exceptions or return 5xx responses
- Development-only usage
Design considerations
- The command should be fully opt-in and not affect existing behavior.
- No network requests; use Flask’s built-in test client.
- Keep output simple and readable (similar to
flask routes). - Advanced features (custom payloads, auth, etc.) could be out of scope initially.
Open questions
- Should this live as a core CLI command or as an optional extension?
- How should endpoints with required parameters or authentication be handled?
- Should the command fail on the first error or report all failures?
Feedback on the general direction and scope would be appreciated before
starting an implementation.