-
Notifications
You must be signed in to change notification settings - Fork 32
✨ feat(phone): Add Pydantic phone number validation to reduce SMS waste in input schemas #8115
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
✨ feat(phone): Add Pydantic phone number validation to reduce SMS waste in input schemas #8115
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8115 +/- ##
==========================================
+ Coverage 87.67% 88.20% +0.52%
==========================================
Files 1700 1890 +190
Lines 66037 72631 +6594
Branches 822 1277 +455
==========================================
+ Hits 57900 64061 +6161
- Misses 7920 8189 +269
- Partials 217 381 +164
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
f6154b0 to
53c8407
Compare
sanderegg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Nevertheless I more and more find that the way we install our packages is wrong. Why would for example the clusers-keeper care about phone numbers... and now all of these services need to install an additional library even though only one uses it. This blows up the container image sizes, and decreases security. nothing to do now though. that is just a thought.
GitHK
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fancy!
giancarloromeo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
matusdrobuliak66
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
19bcf78 to
f2a1c8f
Compare
|
@mergify queue |
🟠 Waiting for conditions to match
|
fe78048 to
da58d27
Compare
|
@mergify queue |
🟠 Waiting for conditions to match
|
|



What do these changes do?
✨ Add phone number validation
Add phone number validation using pydantic_extra_types.phone_numbers to prevent SMS waste. Note that this validation only happens in input schemas, namely the phone field in:
⬆️ adds
phonenumberlibraryAdds in models_library and propagates downstream from
models_libraryrequirements♻️ Normalized error in
request_validationto comply withEnvelopedErrorFound this issue and decided to refactor it properly. Now, 422 validation errors display correct enveloped error model. For instance
{ "error": { "message": "Invalid parameter/s 'label' in request query", "status": 422, "errors": [ { "code": "missing", "message": "Field required", "resource": "/projects/9a164106-cf6a-459e-b486-2b21fb97d435", "field": "label" } ] } }Related issue/s
How to test
Dev-ops
None