mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 14:31:57 -05:00
Added schemas + tests & updated get template tests
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from app.models import TEMPLATE_TYPES
|
||||
from app.schema_validation.definitions import uuid
|
||||
from app.schema_validation.definitions import uuid, personalisation
|
||||
|
||||
|
||||
get_template_by_id_request = {
|
||||
@@ -39,3 +39,30 @@ get_template_by_id_response = {
|
||||
},
|
||||
"required": ["id", "type", "created_at", "updated_at", "version", "created_by", "body"]
|
||||
}
|
||||
|
||||
post_template_preview_request = {
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"description": "POST template schema",
|
||||
"type": "object",
|
||||
"title": "POST v2/template/{id}/preview",
|
||||
"properties": {
|
||||
"id": uuid,
|
||||
"personalisation": personalisation
|
||||
},
|
||||
"required": ["id", "personalisation"]
|
||||
}
|
||||
|
||||
post_template_preview_response = {
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"description": "POST template preview schema response",
|
||||
"type": "object",
|
||||
"title": "reponse v2/template/{id}/preview",
|
||||
"properties": {
|
||||
"id": uuid,
|
||||
"type": {"enum": TEMPLATE_TYPES},
|
||||
"version": {"type": "integer"},
|
||||
"body": {"type": "string"},
|
||||
"subject": {"type": ["string", "null"]}
|
||||
},
|
||||
"required": ["id", "type", "version", "body"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user