Proposal: CLI command to validate API endpoints by making test requests #5862
Replies: 3 comments 5 replies
-
|
I think you could easily create that as a standalone package that integrates in the flask-cli via an entrypoint. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
@ThiefMaster |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
I'll send you a PR for now, so please take a look. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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:
Design considerations
flask routes).Open questions
Feedback on the general direction and scope would be appreciated before
starting an implementation.
Beta Was this translation helpful? Give feedback.
All reactions