-
Notifications
You must be signed in to change notification settings - Fork 135
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
Include postal code example #128
base: main
Are you sure you want to change the base?
Conversation
This is a good idea. However, it looks incomplete. The generate script also creates a postal_code_example for subdivisions, but the subdivision json files weren't updated, and neither was Subdivision.php |
src/AddressFormat/AddressFormat.php
Outdated
* This is an example postal code used to provide additional context to the | ||
* end-user. It can be displayed as a placeholder, field description or as | ||
* part of the validation. | ||
* (E.g. Zip code 12345 is not valid for Louisana (Example: 70001). |
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.
Sentence starts with a parenthesis, but doesn't end with one. I suggest just leaving out the first one and starting with just "E.g."
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 for the feedback. I've addressed this in 7cb62ca
Included subdivisions resources and added postal_code_example to both |
Problem/Motivation
There are many scenarios in which the postal code validation return ambiguous error messages. It might be useful to provide some additional context through a valid example. Google provides a list of valid postal code examples under the
zipex
property. As a first step to improve postal code validation, we would need to include this property in the addressing resources.generate_address_data.php
to includezipex
on both country and subdivision levelpostalCodeExample
and getter toAddressFormat
classCloses #127