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:
Katie Smith
2022-04-19 14:34:39 +01:00
committed by GitHub
36 changed files with 98 additions and 103 deletions

View File

@@ -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'

View File

@@ -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')

View File

@@ -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)

View File

@@ -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": {

View File

@@ -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": {

View File

@@ -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": {

View File

@@ -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": {

View File

@@ -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": {

View File

@@ -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"
}
}

View File

@@ -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": [

View File

@@ -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": [