Files
notifications-api/app/schema_validation/definitions.py
Leo Hemsted 7f4eec79e4 add POST letter schema
similar to sms/email, however, for consistency with response values
and internal storage, rather than supplying an "email_address" field
or a "phone_number" field, supply an "address_line_1" and "postcode"
field within the personalisation object.
2017-07-19 17:02:19 +01:00

34 lines
1.0 KiB
Python

"""
Definitions are intended for schema definitions that are not likely to change from version to version.
If the definition is specific to a version put it in a definition file in the version package
"""
uuid = {
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
"validationMessage": "is not a valid UUID",
"code": "1001", # yet to be implemented
"link": "link to our error documentation not yet implemented"
}
personalisation = {
"type": "object",
"validationMessage": "should contain key value pairs",
"code": "1001", # yet to be implemented
"link": "link to our error documentation not yet implemented"
}
letter_personalisation = dict(personalisation, required=["address_line_1", "postcode"])
https_url = {
"type": "string",
"format": "uri",
"pattern": "^https.*",
"validationMessage": "is not a valid https url",
"code": "1001", # yet to be implemented
"link": "link to our error documentation not yet implemented"
}