Update definitions to check non empty strings

This commit is contained in:
Ken Tsang
2017-09-11 15:36:32 +01:00
parent 62f561c4d1
commit 41f427d6dd
2 changed files with 53 additions and 5 deletions

View File

@@ -19,7 +19,27 @@ personalisation = {
}
letter_personalisation = dict(personalisation, required=["address_line_1", "address_line_2", "postcode"])
letter_personalisation = dict(
personalisation,
properties={
"address_line_1": {
"type": "string",
"minLength": 1,
"validationMessage": "address_line_1 is required"
},
"address_line_2": {
"type": "string",
"minLength": 1,
"validationMessage": "address_line_2 is required"
},
"postcode": {
"type": "string",
"minLength": 1,
"validationMessage": "postcode is required"
},
},
required=["address_line_1", "address_line_2", "postcode"],
)
https_url = {