mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-23 11:29:50 -05:00
We have three different ways of checking the formats of datetimes.
1. The built-in way that comes with the jsonschema package ("date-time")
2. A new way we added for broadcasts ("datetime") 61a5730596
3. An old way we defined in
"/tests/app/public_contracts/schemas/v0/definitions.json"
In order to simplify things and make it clearer how datetimes are being
validated, this replaces the few places where we were using option 3 with option 1
instead. Option 3 was only being used to validate code that is no longer
used, the initial version of the API.
99 lines
2.4 KiB
JSON
99 lines
2.4 KiB
JSON
{
|
|
"description": "Single sms notification schema - as returned by GET /notification and GET /notification/{}",
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {"$ref": "definitions.json#/uuid"},
|
|
"to": {"type": "string"},
|
|
"job_row_number": {"oneOf":[
|
|
{"type": "number"},
|
|
{"type": "null"}
|
|
]},
|
|
"template_version": {"type": "number"},
|
|
"billable_units": {"type": "number"},
|
|
"notification_type": {
|
|
"type": "string",
|
|
"enum": ["sms"]
|
|
},
|
|
"created_at": {"type": "string", "format": "date-time"},
|
|
"sent_at": {"type": ["string", "null"], "format": "date-time"},
|
|
"sent_by": {"oneOf":[
|
|
{"type": "string"},
|
|
{"type": "null"}
|
|
]},
|
|
"updated_at": {"type": ["string", "null"], "format": "date-time"},
|
|
"status": {
|
|
"type": "string",
|
|
"enum": [
|
|
"created",
|
|
"sending",
|
|
"delivered",
|
|
"pending",
|
|
"failed",
|
|
"technical-failure",
|
|
"temporary-failure",
|
|
"permanent-failure"
|
|
]
|
|
},
|
|
"reference": {"oneOf":[
|
|
{"type": "string"},
|
|
{"type": "null"}
|
|
]},
|
|
"template": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {"$ref": "definitions.json#/uuid"},
|
|
"name": {"type": "string"},
|
|
"template_type": {
|
|
"type": "string",
|
|
"enum": ["sms"]
|
|
},
|
|
"version": {"type": "number"}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": ["id", "name", "template_type", "version"]
|
|
},
|
|
"service": {"$ref": "definitions.json#/uuid"},
|
|
"job": {
|
|
"oneOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {"$ref": "definitions.json#/uuid"},
|
|
"original_file_name": {"type": "string"}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": ["id", "original_file_name"]
|
|
},
|
|
{"type": "null"}
|
|
]
|
|
},
|
|
"api_key": {"oneOf":[
|
|
{"$ref": "definitions.json#/uuid"},
|
|
{"type": "null"}
|
|
]},
|
|
"body": {"type": "string"},
|
|
"content_char_count": {"type": "number"}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"id",
|
|
"to",
|
|
"job_row_number",
|
|
"template_version",
|
|
"billable_units",
|
|
"notification_type",
|
|
"created_at",
|
|
"sent_at",
|
|
"sent_by",
|
|
"updated_at",
|
|
"status",
|
|
"reference",
|
|
"template",
|
|
"service",
|
|
"job",
|
|
"api_key",
|
|
"body",
|
|
"content_char_count"
|
|
]
|
|
}
|