Fix West African mobile money phone number validation regex#242
Fix West African mobile money phone number validation regex#242matthappens merged 1 commit intomainfrom
Conversation
The compiled openapi.yaml and mintlify/openapi.yaml contained the
looser pattern ^\+(221|225|229)[0-9]{8,10}$ which incorrectly
accepted wrong digit counts per country. The source file
openapi/components/schemas/common/XofAccountInfo.yaml already had
the correct per-country pattern ^\+(221[0-9]{9}|225[0-9]{10}|229[0-9]{8,9})$.
Ran `make build` to rebundle the spec, syncing both compiled files
with the precise pattern that enforces:
- Senegal (+221): exactly 9 digits
- Ivory Coast (+225): exactly 10 digits
- Benin (+229): 8 or 9 digits
https://claude.ai/code/session_01S828qqdXMuJAHkXqNubQxh
✱ Stainless preview buildsThis PR will update the kotlin openapi python typescript ✅ grid-python studio · code
|
Greptile SummaryThis PR tightens the West African mobile money phone number validation regex in both
Confidence Score: 5/5
|
Summary
Updated the phone number validation regex pattern for West African mobile money numbers to enforce country-specific digit requirements instead of a generic range.
Key Changes
[0-9]{8,10}to strict[0-9]{9}(9 digits after country code)[0-9]{8,10}to strict[0-9]{10}(10 digits after country code)[0-9]{8,10}to strict[0-9]{8,9}(8-9 digits after country code)Implementation Details
The previous regex pattern
^\+(221|225|229)[0-9]{8,10}$accepted any combination of 8-10 digits for all three countries, which was too permissive and could allow invalid phone numbers. The updated pattern^\+(221[0-9]{9}|225[0-9]{10}|229[0-9]{8,9})$now validates each country code with its correct digit length requirements, improving data quality and reducing invalid number submissions.https://claude.ai/code/session_01S828qqdXMuJAHkXqNubQxh