RandomAPI / Randomuser.me-old-source

[Deprecated] PHP source for Random User Generator - Please take a look at the new Node version
https://randomuser.me
137 stars 48 forks source link

Field naming standards, for localisation purposes #39

Closed James-Machouk closed 9 years ago

James-Machouk commented 9 years ago

i'm suggesting a solution that can be very useful for the utilization of this API by developers. i figured out that some fields changes name for every nationality, we have the "Zip" field and the " Social Security number " field that change name. - zip field - For all nationality it is named "zip" but for GB it is named "Postcode" - Social Security number field - here a the list of every nationality available now on the API AU = PPS DE = HETU ES = DNI FI = HETU FR = INSEE GB = NINO IE = PPS NL = BNS US = SSN

this is a model that works with US ( see the field SSN ) : image

but if we change the nationality for exemple DE ( the field needs to be named HETU ) and if i use the same Model my application will crash, Yes i can add some conditions, but i know that the API is growing and later some new nationalities will be added,

i propose : 1) change the name of the security number to "IDnumber" 2) we add a new field "IDnotation" that hold the diffrent naming variations. 3) we have to chose between "Zip" or "Postcode" and use it for all nationalities

keitharm commented 9 years ago

Sounds good! Field names will be consistent across nationalities in the next major update.