mirror of
https://github.com/GSA/notifications-api.git
synced 2026-05-03 15:50:12 -04:00
Merge pull request #3512 from alphagov/bump-json-schemas
Bump jsonschema package from 3.2.0 to 4.4.0
This commit is contained in:
@@ -87,5 +87,4 @@ def test_get_complaint_with_invalid_data_returns_400_status_code(client):
|
||||
)
|
||||
|
||||
assert response.status_code == 400
|
||||
assert response.json['errors'][0]['message'] == 'start_date time data {} does not match format %Y-%m-%d'.format(
|
||||
start_date)
|
||||
assert response.json['errors'][0]['message'] == 'start_date month must be in 1..12'
|
||||
|
||||
@@ -48,8 +48,7 @@ def test_get_platform_stats_validates_the_date(admin_request):
|
||||
_expected_status=400
|
||||
)
|
||||
|
||||
assert response['errors'][0]['message'] == 'start_date time data {} does not match format %Y-%m-%d'.format(
|
||||
start_date)
|
||||
assert response['errors'][0]['message'] == 'start_date month must be in 1..12'
|
||||
|
||||
|
||||
@freeze_time('2018-10-31 14:00')
|
||||
|
||||
@@ -2,7 +2,7 @@ import os
|
||||
|
||||
import jsonschema
|
||||
from flask import json
|
||||
from jsonschema import Draft4Validator
|
||||
from jsonschema import Draft7Validator
|
||||
|
||||
|
||||
def return_json_from_response(response):
|
||||
@@ -22,5 +22,5 @@ def validate_v0(json_to_validate, schema_filename):
|
||||
|
||||
|
||||
def validate(json_to_validate, schema):
|
||||
validator = Draft4Validator(schema)
|
||||
validator = Draft7Validator(schema)
|
||||
validator.validate(json_to_validate, schema)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "GET notification return schema - for email notifications",
|
||||
"type" : "object",
|
||||
"properties": {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "GET notification return schema - for sms notifications",
|
||||
"type" : "object",
|
||||
"properties": {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "GET notification return schema - for sms notifications",
|
||||
"type" : "object",
|
||||
"properties": {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "POST notification return schema - for email notifications",
|
||||
"type" : "object",
|
||||
"properties": {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "POST notification return schema - for sms notifications",
|
||||
"type" : "object",
|
||||
"properties": {
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"description": "Common definitions - usage example: {'$ref': 'definitions.json#/uuid'} (swap quotes for double quotes)",
|
||||
"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}$"
|
||||
},
|
||||
"datetime": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,19 +14,13 @@
|
||||
"type": "string",
|
||||
"enum": ["email"]
|
||||
},
|
||||
"created_at": {"$ref": "definitions.json#/datetime"},
|
||||
"sent_at": {"oneOf":[
|
||||
{"$ref": "definitions.json#/datetime"},
|
||||
{"type": "null"}
|
||||
]},
|
||||
"created_at": {"type": "string", "format": "date-time"},
|
||||
"sent_at": {"type": ["string", "null"], "format": "date-time"},
|
||||
"sent_by": {"oneOf":[
|
||||
{"type": "string"},
|
||||
{"type": "null"}
|
||||
]},
|
||||
"updated_at": {"oneOf":[
|
||||
{"$ref": "definitions.json#/datetime"},
|
||||
{"type": "null"}
|
||||
]},
|
||||
"updated_at": {"type": ["string", "null"], "format": "date-time"},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
|
||||
@@ -14,19 +14,13 @@
|
||||
"type": "string",
|
||||
"enum": ["sms"]
|
||||
},
|
||||
"created_at": {"$ref": "definitions.json#/datetime"},
|
||||
"sent_at": {"oneOf":[
|
||||
{"$ref": "definitions.json#/datetime"},
|
||||
{"type": "null"}
|
||||
]},
|
||||
"created_at": {"type": "string", "format": "date-time"},
|
||||
"sent_at": {"type": ["string", "null"], "format": "date-time"},
|
||||
"sent_by": {"oneOf":[
|
||||
{"type": "string"},
|
||||
{"type": "null"}
|
||||
]},
|
||||
"updated_at": {"oneOf":[
|
||||
{"$ref": "definitions.json#/datetime"},
|
||||
{"type": "null"}
|
||||
]},
|
||||
"updated_at": {"type": ["string", "null"], "format": "date-time"},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
|
||||
Reference in New Issue
Block a user