Use json schema to validate post request to send PDF letter

This approach was suggested as the way to do validation things on
Notify.
This commit is contained in:
David McDonald
2019-10-25 11:27:28 +01:00
parent 7f708153d2
commit d1195dfd5a
5 changed files with 35 additions and 28 deletions

View File

@@ -0,0 +1,14 @@
send_pdf_letter_request = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "POST send uploaded pdf letter",
"type": "object",
"title": "Send an uploaded pdf letter",
"properties": {
"postage": {"enum": ["first", "second"]},
"filename": {"type": "string"},
"created_by": {"type": "string"},
"file_id": {"type": "string"},
},
"required": ["postage", "filename", "created_by", "file_id"]
}