Skip to content

Commit da2fa99

Browse files
authored
feat: text input validation for Box Sign (#568)
1 parent 932f376 commit da2fa99

File tree

3 files changed

+545
-7
lines changed

3 files changed

+545
-7
lines changed

openapi.json

Lines changed: 272 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"url": "http://www.apache.org/licenses/LICENSE-2.0"
1515
},
1616
"version": "2024.0",
17-
"x-box-commit-hash": "989ee7d3a1"
17+
"x-box-commit-hash": "851befaf8c"
1818
},
1919
"servers": [
2020
{
@@ -36504,9 +36504,27 @@
3650436504
"example": 4
3650536505
},
3650636506
"read_only": {
36507-
"description": "Whether this input was defined as read-only(immutable by signers) or not.",
36507+
"description": "Indicates whether this input is read-only (cannot be modified by signers).",
3650836508
"type": "boolean",
3650936509
"example": true
36510+
},
36511+
"validation": {
36512+
"description": "Specifies the formatting rules that signers must follow for text field inputs.\nIf set, this validation is mandatory.",
36513+
"example": {
36514+
"validation_type": "email"
36515+
},
36516+
"anyOf": [
36517+
{
36518+
"$ref": "#/components/schemas/SignRequestSignerInputValidation"
36519+
},
36520+
{
36521+
"title": "OpenAPI 3.0 null schema type",
36522+
"description": "The definition for a null schema type in OpenAPI `3.0`.",
36523+
"type": "object",
36524+
"nullable": true,
36525+
"additionalProperties": false
36526+
}
36527+
]
3651036528
}
3651136529
}
3651236530
}
@@ -36516,6 +36534,239 @@
3651636534
],
3651736535
"title": "Sign Request Signer Input"
3651836536
},
36537+
"SignRequestSignerInputCustomValidation": {
36538+
"description": "Specifies the custom validation rules for a text field input by the signer.\nIf set, this validation is mandatory.",
36539+
"type": "object",
36540+
"properties": {
36541+
"validation_type": {
36542+
"description": "Defines the validation format for the text input as custom.\nA custom regular expression is used for validation.",
36543+
"type": "string",
36544+
"example": "custom",
36545+
"enum": [
36546+
"custom"
36547+
]
36548+
},
36549+
"custom_regex": {
36550+
"description": "Regular expression used for validation.",
36551+
"type": "string",
36552+
"example": "(^[a-zA-Z0-9._%+-]+)",
36553+
"nullable": true
36554+
},
36555+
"custom_error_message": {
36556+
"description": "Error message shown if input fails custom regular expression validation.",
36557+
"type": "string",
36558+
"example": "Please enter a valid value.",
36559+
"nullable": true
36560+
}
36561+
},
36562+
"required": [
36563+
"validation_type",
36564+
"custom_regex",
36565+
"custom_error_message"
36566+
],
36567+
"title": "Sign Request Signer Input Custom Validation"
36568+
},
36569+
"SignRequestSignerInputDateAsiaValidation": {
36570+
"description": "Specifies the date formatting rules used in Asia for a text field input by the signer. \nIf set, this validation is mandatory. \nThe date format follows `YYYY/MM/DD` pattern.",
36571+
"type": "object",
36572+
"properties": {
36573+
"validation_type": {
36574+
"description": "Validates that the text input uses the Asian date format `YYYY/MM/DD`.",
36575+
"type": "string",
36576+
"example": "date_asia",
36577+
"enum": [
36578+
"date_asia"
36579+
]
36580+
}
36581+
},
36582+
"title": "Sign Request Signer Input Date Asia Validation"
36583+
},
36584+
"SignRequestSignerInputDateEUValidation": {
36585+
"description": "Specifies the date formatting rules used in Europe for a text field input by the signer. \nIf set, this validation is mandatory. \nThe date format follows `DD/MM/YYYY` pattern.",
36586+
"type": "object",
36587+
"properties": {
36588+
"validation_type": {
36589+
"description": "Validates that the text input uses the European date format `DD/MM/YYYY`.",
36590+
"type": "string",
36591+
"example": "date_eu",
36592+
"enum": [
36593+
"date_eu"
36594+
]
36595+
}
36596+
},
36597+
"title": "Sign Request Signer Input Date EU Validation"
36598+
},
36599+
"SignRequestSignerInputDateISOValidation": {
36600+
"description": "Specifies the ISO date formatting rules for a text field input by the signer. \nIf set, this validation is mandatory. \nThe date format follows `YYYY-MM-DD` pattern.",
36601+
"type": "object",
36602+
"properties": {
36603+
"validation_type": {
36604+
"description": "Validates that the text input uses the ISO date format `YYYY-MM-DD`.",
36605+
"type": "string",
36606+
"example": "date_iso",
36607+
"enum": [
36608+
"date_iso"
36609+
]
36610+
}
36611+
},
36612+
"title": "Sign Request Signer Input Date ISO Validation"
36613+
},
36614+
"SignRequestSignerInputDateUSValidation": {
36615+
"description": "Specifies the US date formatting rules for a text field input by the signer. \nIf set, this validation is mandatory. \nThe date format follows `MM/DD/YYYY` pattern.",
36616+
"type": "object",
36617+
"properties": {
36618+
"validation_type": {
36619+
"description": "Validates that the text input uses the US date format `MM/DD/YYYY`.",
36620+
"type": "string",
36621+
"example": "date_us",
36622+
"enum": [
36623+
"date_us"
36624+
]
36625+
}
36626+
},
36627+
"title": "Sign Request Signer Input Date US Validation"
36628+
},
36629+
"SignRequestSignerInputEmailValidation": {
36630+
"description": "Specifies the formatting rules that signers must follow for text field inputs.\nIf set, this validation is mandatory.",
36631+
"type": "object",
36632+
"properties": {
36633+
"validation_type": {
36634+
"description": "Validates that the text input is an email address.",
36635+
"type": "string",
36636+
"example": "email",
36637+
"enum": [
36638+
"email"
36639+
]
36640+
}
36641+
},
36642+
"required": [
36643+
"validation_type"
36644+
],
36645+
"title": "Sign Request Signer Input Email Validation"
36646+
},
36647+
"SignRequestSignerInputNumberWithCommaValidation": {
36648+
"description": "Specifies the number with comma formatting rules for a text field input by the signer.\nIf set, this validation is mandatory.",
36649+
"type": "object",
36650+
"properties": {
36651+
"validation_type": {
36652+
"description": "Validates that the text input uses a number format with a comma as the decimal separator (for example, 1,23).",
36653+
"type": "string",
36654+
"example": "number_with_comma",
36655+
"enum": [
36656+
"number_with_comma"
36657+
]
36658+
}
36659+
},
36660+
"title": "Sign Request Signer Input Number With Comma Validation"
36661+
},
36662+
"SignRequestSignerInputNumberWithPeriodValidation": {
36663+
"description": "Specifies the number with period formatting rules for a text field input by the signer.\nIf set, this validation is mandatory.",
36664+
"type": "object",
36665+
"properties": {
36666+
"validation_type": {
36667+
"description": "Validates that the text input uses a number format with a period as the decimal separator (for example, 1.23).",
36668+
"type": "string",
36669+
"example": "number_with_period",
36670+
"enum": [
36671+
"number_with_period"
36672+
]
36673+
}
36674+
},
36675+
"title": "Sign Request Signer Input Number With Period Validation"
36676+
},
36677+
"SignRequestSignerInputSSNValidation": {
36678+
"description": "Specifies the validation rules for a text field input by the signer.\nIf set, this validation is mandatory.",
36679+
"type": "object",
36680+
"properties": {
36681+
"validation_type": {
36682+
"description": "Validates that the text input is a Social Security Number (SSN).",
36683+
"type": "string",
36684+
"example": "ssn",
36685+
"enum": [
36686+
"ssn"
36687+
]
36688+
}
36689+
},
36690+
"required": [
36691+
"validation_type"
36692+
],
36693+
"title": "Sign Request Signer Input SSN Validation"
36694+
},
36695+
"SignRequestSignerInputValidation": {
36696+
"description": "Specifies the formatting rules that signers must follow for text field inputs.\nIf set, this validation is mandatory. \nThe format can be selected from a predefined list of options (e.g., email, phone number, date) or\ndefined using a custom regular expression.",
36697+
"oneOf": [
36698+
{
36699+
"$ref": "#/components/schemas/SignRequestSignerInputEmailValidation"
36700+
},
36701+
{
36702+
"$ref": "#/components/schemas/SignRequestSignerInputCustomValidation"
36703+
},
36704+
{
36705+
"$ref": "#/components/schemas/SignRequestSignerInputZIPValidation"
36706+
},
36707+
{
36708+
"$ref": "#/components/schemas/SignRequestSignerInputZIP4Validation"
36709+
},
36710+
{
36711+
"$ref": "#/components/schemas/SignRequestSignerInputSSNValidation"
36712+
},
36713+
{
36714+
"$ref": "#/components/schemas/SignRequestSignerInputNumberWithPeriodValidation"
36715+
},
36716+
{
36717+
"$ref": "#/components/schemas/SignRequestSignerInputNumberWithCommaValidation"
36718+
},
36719+
{
36720+
"$ref": "#/components/schemas/SignRequestSignerInputDateISOValidation"
36721+
},
36722+
{
36723+
"$ref": "#/components/schemas/SignRequestSignerInputDateUSValidation"
36724+
},
36725+
{
36726+
"$ref": "#/components/schemas/SignRequestSignerInputDateEUValidation"
36727+
},
36728+
{
36729+
"$ref": "#/components/schemas/SignRequestSignerInputDateAsiaValidation"
36730+
}
36731+
],
36732+
"title": "Sign Request Signer Input Validation"
36733+
},
36734+
"SignRequestSignerInputZIP4Validation": {
36735+
"description": "Specifies the validation rules for a text field input by the signer.\nIf set, this validation is mandatory.",
36736+
"type": "object",
36737+
"properties": {
36738+
"validation_type": {
36739+
"description": "Validates that the text input is a ZIP+4 code.",
36740+
"type": "string",
36741+
"example": "zip_4",
36742+
"enum": [
36743+
"zip_4"
36744+
]
36745+
}
36746+
},
36747+
"required": [
36748+
"validation_type"
36749+
],
36750+
"title": "Sign Request Signer Input ZIP 4 Validation"
36751+
},
36752+
"SignRequestSignerInputZIPValidation": {
36753+
"description": "Specifies the validation rules for a text field input by the signer.\nIf set, this validation is mandatory.",
36754+
"type": "object",
36755+
"properties": {
36756+
"validation_type": {
36757+
"description": "Validates that the text input is a ZIP code.",
36758+
"type": "string",
36759+
"example": "zip",
36760+
"enum": [
36761+
"zip"
36762+
]
36763+
}
36764+
},
36765+
"required": [
36766+
"validation_type"
36767+
],
36768+
"title": "Sign Request Signer Input ZIP Validation"
36769+
},
3651936770
"SignRequests": {
3652036771
"description": "A standard representation of a signature request, as returned from any Box Sign\nAPI endpoints by default.",
3652136772
"type": "object",
@@ -37649,9 +37900,27 @@
3764937900
"nullable": true
3765037901
},
3765137902
"read_only": {
37652-
"description": "Whether this input was defined as read-only(immutable by signers) or not.",
37903+
"description": "Indicates whether this input is read-only (cannot be modified by signers).",
3765337904
"type": "boolean",
3765437905
"example": true
37906+
},
37907+
"validation": {
37908+
"description": "Specifies the formatting rules that signers must follow for text field inputs.\nIf set, this validation is mandatory.",
37909+
"example": {
37910+
"validation_type": "email"
37911+
},
37912+
"anyOf": [
37913+
{
37914+
"$ref": "#/components/schemas/SignRequestSignerInputValidation"
37915+
},
37916+
{
37917+
"title": "OpenAPI 3.0 null schema type",
37918+
"description": "The definition for a null schema type in OpenAPI `3.0`.",
37919+
"type": "object",
37920+
"nullable": true,
37921+
"additionalProperties": false
37922+
}
37923+
]
3765537924
}
3765637925
}
3765737926
}

openapi/openapi-v2025.0.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"url": "http://www.apache.org/licenses/LICENSE-2.0"
1515
},
1616
"version": "2025.0",
17-
"x-box-commit-hash": "989ee7d3a1"
17+
"x-box-commit-hash": "851befaf8c"
1818
},
1919
"servers": [
2020
{

0 commit comments

Comments
 (0)