mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-18 21:48:49 -04:00
Remove one of our own jsonschema date-time formatters
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.
This commit is contained in:
@@ -4,9 +4,5 @@
|
|||||||
"uuid": {
|
"uuid": {
|
||||||
"type": "string",
|
"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}$"
|
"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}$"
|
||||||
},
|
|
||||||
"datetime": {
|
|
||||||
"type": "string",
|
|
||||||
"format": "date-time"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,19 +14,13 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": ["email"]
|
"enum": ["email"]
|
||||||
},
|
},
|
||||||
"created_at": {"$ref": "definitions.json#/datetime"},
|
"created_at": {"type": "string", "format": "date-time"},
|
||||||
"sent_at": {"oneOf":[
|
"sent_at": {"type": ["string", "null"], "format": "date-time"},
|
||||||
{"$ref": "definitions.json#/datetime"},
|
|
||||||
{"type": "null"}
|
|
||||||
]},
|
|
||||||
"sent_by": {"oneOf":[
|
"sent_by": {"oneOf":[
|
||||||
{"type": "string"},
|
{"type": "string"},
|
||||||
{"type": "null"}
|
{"type": "null"}
|
||||||
]},
|
]},
|
||||||
"updated_at": {"oneOf":[
|
"updated_at": {"type": ["string", "null"], "format": "date-time"},
|
||||||
{"$ref": "definitions.json#/datetime"},
|
|
||||||
{"type": "null"}
|
|
||||||
]},
|
|
||||||
"status": {
|
"status": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
|
|||||||
@@ -14,19 +14,13 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": ["sms"]
|
"enum": ["sms"]
|
||||||
},
|
},
|
||||||
"created_at": {"$ref": "definitions.json#/datetime"},
|
"created_at": {"type": "string", "format": "date-time"},
|
||||||
"sent_at": {"oneOf":[
|
"sent_at": {"type": ["string", "null"], "format": "date-time"},
|
||||||
{"$ref": "definitions.json#/datetime"},
|
|
||||||
{"type": "null"}
|
|
||||||
]},
|
|
||||||
"sent_by": {"oneOf":[
|
"sent_by": {"oneOf":[
|
||||||
{"type": "string"},
|
{"type": "string"},
|
||||||
{"type": "null"}
|
{"type": "null"}
|
||||||
]},
|
]},
|
||||||
"updated_at": {"oneOf":[
|
"updated_at": {"type": ["string", "null"], "format": "date-time"},
|
||||||
{"$ref": "definitions.json#/datetime"},
|
|
||||||
{"type": "null"}
|
|
||||||
]},
|
|
||||||
"status": {
|
"status": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
|
|||||||
Reference in New Issue
Block a user