Closed sergeycherepanov closed 3 years ago
Hi @sergeycherepanov, I haven't found any definition about phone number format / type in JSON schema, can you point me to the right place?
@kenspirit the phone type provided by 3dr party extension https://github.com/Salesflare/joi-phone-number
@sergeycherepanov ic. The extension allows joi to support custom field/format.
But the JSON schema does not support these properties (defaultCountry
, phoneNumberFormat
, strict
) and 'phoneNumber' format. What is the benefit and usage to add them to the converted JSON schema?
hi @kenspirit I just needed to indicate the field type. Because without it the API clients can't recognize the required value format. The details about the format are not so important. But the schema should indicate that a field should be a valid phone number. Like it has done for email.
In the our system, the phone number is a unique identifier for users (something like email in common online services) and the schema is exported to 3rd party clients.
@sergeycherepanov In the new 2.x version, taking advantage of joi.meta()
can output extension properties, such as x-foo
. Please take a look.
Currently, the phone number rules showed without format