Gender null is an answer
/name splits, cases, and returns gender when the first name is clearly one. Mixed names leave gender and salutation null.
Jordan is a name. gender stays null.
GET /name/Michael
{
"name": "Michael",
"valid": true,
"prefix": null,
"first": "Michael",
"middle": null,
"last": null,
"suffix": null,
"gender": "male",
"salutation": "Mr"
}
GET /name/Jordan
{
"name": "Jordan",
"valid": true,
"prefix": null,
"first": "Jordan",
"middle": null,
"last": null,
"suffix": null,
"gender": null,
"salutation": null
}
/name splits a string into prefix, first, middle, last, suffix, and proper-cases it. gender fills only when the first name is clearly male or female. Taylor comes back the same way Jordan does, gender null, salutation null. salutation follows gender, so Mr and Ms never show up without it.
The name still parses
valid is whether the string is a name, not whether we know the gender. Grace Hopper comes back first Grace, last Hopper, gender female, salutation Ms. A form can store the parts on every row and only print a salutation when the field is there.
Try it
Call /name with Michael, then Jordan, then Taylor. All three are names. Only one of them gets Mr.