Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Refactor SMS sender app to use async httpx and improved validation #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Manodeepray wants to merge 3 commits into keploy:main
base: main
Choose a base branch
Loading
from Manodeepray:my-contri-branch

Conversation

@Manodeepray
Copy link

@Manodeepray Manodeepray commented Jun 19, 2025

This PR refactors the SMS sender FastAPI app for improved performance, validation, and error handling. Key changes:

An overal summary

  • Migrated from synchronous requests to asynchronous httpx.AsyncClient
  • Added input validation using pydantic.Field
  • Introduced async lifespan() for modern startup/shutdown handling
  • Improved error handling with detailed logs and structured JSONResponse
  • Updated requirements.txt

Changes i made

✅ Replaced requests.post with httpx.AsyncClient
✅ Updated endpoint to async def
✅ Added phone number pattern validation (+91... etc.)
✅ Introduced lifespan() for lifecycle management
✅ Added proper error responses with status codes
✅ Updated logging for Twilio and HTTP errors
✅ Created requirements.txt with minimal necessary deps

Copy link

Thank you for raising the pr, Our team will review the pr soon before that please make sure to sign the DCO.

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /