Use Draft-07 and Draft7Validator everywhere

We were using the Draft4Validator in one place, so this updates it to
the Draft7Validator instead.

The schemas were mostly using draft 4 of the JSON schema, though there
were a couple of schemas that were already of version 7. This updates
them all to version 7, which is the latest version fully supported by
the jsonschema Python package. There are some breaking changes in the
newer version of the schema, but I could not see anywhere would these
affect us. Some of these schemas were not valid in version 4, but are
now valid in version 7 because `"required": []` was not valid in earlier
versions.
This commit is contained in:
Katie Smith
2022-04-08 17:05:59 +01:00
parent f17e01c90a
commit b440f3f904
30 changed files with 67 additions and 67 deletions

View File

@@ -1,7 +1,7 @@
from datetime import datetime from datetime import datetime
create_or_update_free_sms_fragment_limit_schema = { create_or_update_free_sms_fragment_limit_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST annual billing schema", "description": "POST annual billing schema",
"type": "object", "type": "object",
"title": "Create", "title": "Create",

View File

@@ -2,7 +2,7 @@ from app.models import BroadcastStatusType
from app.schema_validation.definitions import uuid from app.schema_validation.definitions import uuid
create_broadcast_message_schema = { create_broadcast_message_schema = {
'$schema': 'http://json-schema.org/draft-04/schema#', '$schema': 'http://json-schema.org/draft-07/schema#',
'description': 'POST create broadcast_message schema', 'description': 'POST create broadcast_message schema',
'type': 'object', 'type': 'object',
'title': 'Create broadcast_message', 'title': 'Create broadcast_message',
@@ -32,7 +32,7 @@ create_broadcast_message_schema = {
} }
update_broadcast_message_schema = { update_broadcast_message_schema = {
'$schema': 'http://json-schema.org/draft-04/schema#', '$schema': 'http://json-schema.org/draft-07/schema#',
'description': 'POST update broadcast_message schema', 'description': 'POST update broadcast_message schema',
'type': 'object', 'type': 'object',
'title': 'Update broadcast_message', 'title': 'Update broadcast_message',
@@ -47,7 +47,7 @@ update_broadcast_message_schema = {
} }
update_broadcast_message_status_schema = { update_broadcast_message_status_schema = {
'$schema': 'http://json-schema.org/draft-04/schema#', '$schema': 'http://json-schema.org/draft-07/schema#',
'description': 'POST update broadcast_message status schema', 'description': 'POST update broadcast_message status schema',
'type': 'object', 'type': 'object',
'title': 'Update broadcast_message', 'title': 'Update broadcast_message',

View File

@@ -1,6 +1,6 @@
complaint_count_request = { complaint_count_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "complaint count request schema", "description": "complaint count request schema",
"type": "object", "type": "object",
"title": "Complaint count request", "title": "Complaint count request",

View File

@@ -1,7 +1,7 @@
from app.models import BRANDING_TYPES from app.models import BRANDING_TYPES
post_create_email_branding_schema = { post_create_email_branding_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST schema for getting email_branding", "description": "POST schema for getting email_branding",
"type": "object", "type": "object",
"properties": { "properties": {
@@ -15,7 +15,7 @@ post_create_email_branding_schema = {
} }
post_update_email_branding_schema = { post_update_email_branding_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST schema for getting email_branding", "description": "POST schema for getting email_branding",
"type": "object", "type": "object",
"properties": { "properties": {

View File

@@ -1,5 +1,5 @@
get_inbound_sms_for_service_schema = { get_inbound_sms_for_service_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "schema for parameters allowed when searching for to field=", "description": "schema for parameters allowed when searching for to field=",
"type": "object", "type": "object",
"properties": { "properties": {

View File

@@ -1,5 +1,5 @@
post_letter_branding_schema = { post_letter_branding_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST schema for creating or updating a letter brand", "description": "POST schema for creating or updating a letter brand",
"type": "object", "type": "object",
"properties": { "properties": {

View File

@@ -1,5 +1,5 @@
letter_references = { letter_references = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "list of letter notification references", "description": "list of letter notification references",
"type": "object", "type": "object",
"title": "references", "title": "references",

View File

@@ -17,7 +17,7 @@ register_errors(letter_callback_blueprint)
dvla_sns_callback_schema = { dvla_sns_callback_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "sns callback received on s3 update", "description": "sns callback received on s3 update",
"type": "object", "type": "object",
"title": "dvla internal sns callback", "title": "dvla internal sns callback",

View File

@@ -2,7 +2,7 @@ from app.models import INVITED_USER_STATUS_TYPES, ORGANISATION_TYPES
from app.schema_validation.definitions import uuid from app.schema_validation.definitions import uuid
post_create_organisation_schema = { post_create_organisation_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST organisation schema", "description": "POST organisation schema",
"type": "object", "type": "object",
"properties": { "properties": {
@@ -15,7 +15,7 @@ post_create_organisation_schema = {
} }
post_update_organisation_schema = { post_update_organisation_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST organisation schema", "description": "POST organisation schema",
"type": "object", "type": "object",
"properties": { "properties": {
@@ -28,7 +28,7 @@ post_update_organisation_schema = {
} }
post_link_service_to_organisation_schema = { post_link_service_to_organisation_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST link service to organisation schema", "description": "POST link service to organisation schema",
"type": "object", "type": "object",
"properties": { "properties": {
@@ -39,7 +39,7 @@ post_link_service_to_organisation_schema = {
post_create_invited_org_user_status_schema = { post_create_invited_org_user_status_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST create organisation invite schema", "description": "POST create organisation invite schema",
"type": "object", "type": "object",
"properties": { "properties": {
@@ -52,7 +52,7 @@ post_create_invited_org_user_status_schema = {
post_update_invited_org_user_status_schema = { post_update_invited_org_user_status_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST update organisation invite schema", "description": "POST update organisation invite schema",
"type": "object", "type": "object",
"properties": { "properties": {

View File

@@ -1,5 +1,5 @@
performance_dashboard_request = { performance_dashboard_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "Performance dashboard request schema", "description": "Performance dashboard request schema",
"type": "object", "type": "object",
"title": "Performance dashboard request", "title": "Performance dashboard request",

View File

@@ -1,5 +1,5 @@
platform_stats_request = { platform_stats_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "platform stats request schema", "description": "platform stats request schema",
"type": "object", "type": "object",
"title": "Platform stats request", "title": "Platform stats request",

View File

@@ -1,5 +1,5 @@
send_pdf_letter_request = { send_pdf_letter_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST send uploaded pdf letter", "description": "POST send uploaded pdf letter",
"type": "object", "type": "object",
"title": "Send an uploaded pdf letter", "title": "Send an uploaded pdf letter",

View File

@@ -1,5 +1,5 @@
service_broadcast_settings_schema = { service_broadcast_settings_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "Set a services broadcast settings", "description": "Set a services broadcast settings",
"type": "object", "type": "object",
"title": "Set a services broadcast settings", "title": "Set a services broadcast settings",

View File

@@ -1,7 +1,7 @@
from app.schema_validation.definitions import https_url, uuid from app.schema_validation.definitions import https_url, uuid
create_service_callback_api_schema = { create_service_callback_api_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST service callback/inbound api schema", "description": "POST service callback/inbound api schema",
"type": "object", "type": "object",
"title": "Create service callback/inbound api", "title": "Create service callback/inbound api",
@@ -14,7 +14,7 @@ create_service_callback_api_schema = {
} }
update_service_callback_api_schema = { update_service_callback_api_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST service callback/inbound api schema", "description": "POST service callback/inbound api schema",
"type": "object", "type": "object",
"title": "Create service callback/inbound api", "title": "Create service callback/inbound api",

View File

@@ -1,7 +1,7 @@
from app.schema_validation.definitions import uuid from app.schema_validation.definitions import uuid
create_service_contact_list_schema = { create_service_contact_list_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST create service contact list schema", "description": "POST create service contact list schema",
"type": "object", "type": "object",
"title": "Create service contact list", "title": "Create service contact list",

View File

@@ -1,5 +1,5 @@
add_service_data_retention_request = { add_service_data_retention_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST service data retention schema", "description": "POST service data retention schema",
"title": "Add service data retention for notification type api", "title": "Add service data retention for notification type api",
"type": "object", "type": "object",
@@ -12,7 +12,7 @@ add_service_data_retention_request = {
update_service_data_retention_request = { update_service_data_retention_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST service data retention schema", "description": "POST service data retention schema",
"title": "Update service data retention for notification type api", "title": "Update service data retention for notification type api",
"type": "object", "type": "object",

View File

@@ -1,7 +1,7 @@
from app.schema_validation.definitions import uuid from app.schema_validation.definitions import uuid
add_service_email_reply_to_request = { add_service_email_reply_to_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST service email reply to address", "description": "POST service email reply to address",
"type": "object", "type": "object",
"title": "Add new email reply to address for service", "title": "Add new email reply to address for service",
@@ -14,7 +14,7 @@ add_service_email_reply_to_request = {
add_service_letter_contact_block_request = { add_service_letter_contact_block_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST service letter contact block", "description": "POST service letter contact block",
"type": "object", "type": "object",
"title": "Add new letter contact block for service", "title": "Add new letter contact block for service",
@@ -27,7 +27,7 @@ add_service_letter_contact_block_request = {
add_service_sms_sender_request = { add_service_sms_sender_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST add service SMS sender", "description": "POST add service SMS sender",
"type": "object", "type": "object",
"title": "Add new SMS sender for service", "title": "Add new SMS sender for service",

View File

@@ -1,7 +1,7 @@
from app.schema_validation.definitions import nullable_uuid, uuid from app.schema_validation.definitions import nullable_uuid, uuid
post_create_template_folder_schema = { post_create_template_folder_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST schema for getting template_folder", "description": "POST schema for getting template_folder",
"type": "object", "type": "object",
"properties": { "properties": {
@@ -12,7 +12,7 @@ post_create_template_folder_schema = {
} }
post_update_template_folder_schema = { post_update_template_folder_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST schema for updating template_folder", "description": "POST schema for updating template_folder",
"type": "object", "type": "object",
"properties": { "properties": {
@@ -23,7 +23,7 @@ post_update_template_folder_schema = {
} }
post_move_template_folder_schema = { post_move_template_folder_schema = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST schema for renaming template_folder", "description": "POST schema for renaming template_folder",
"type": "object", "type": "object",
"properties": { "properties": {

View File

@@ -1,5 +1,5 @@
post_verify_code_schema = { post_verify_code_schema = {
'$schema': 'http://json-schema.org/draft-04/schema#', '$schema': 'http://json-schema.org/draft-07/schema#',
'description': 'POST schema for verifying a 2fa code', 'description': 'POST schema for verifying a 2fa code',
'type': 'object', 'type': 'object',
'properties': { 'properties': {
@@ -12,7 +12,7 @@ post_verify_code_schema = {
post_verify_webauthn_schema = { post_verify_webauthn_schema = {
'$schema': 'http://json-schema.org/draft-04/schema#', '$schema': 'http://json-schema.org/draft-07/schema#',
'description': 'POST schema for verifying a webauthn login attempt', 'description': 'POST schema for verifying a webauthn login attempt',
'type': 'object', 'type': 'object',
'properties': { 'properties': {
@@ -24,7 +24,7 @@ post_verify_webauthn_schema = {
post_send_user_email_code_schema = { post_send_user_email_code_schema = {
'$schema': 'http://json-schema.org/draft-04/schema#', '$schema': 'http://json-schema.org/draft-07/schema#',
'description': ( 'description': (
'POST schema for generating a 2fa email - "to" is required for legacy purposes. ' 'POST schema for generating a 2fa email - "to" is required for legacy purposes. '
'"next" is an optional url to redirect to on sign in' '"next" is an optional url to redirect to on sign in'
@@ -43,7 +43,7 @@ post_send_user_email_code_schema = {
post_send_user_sms_code_schema = { post_send_user_sms_code_schema = {
'$schema': 'http://json-schema.org/draft-04/schema#', '$schema': 'http://json-schema.org/draft-07/schema#',
'description': 'POST schema for generating a 2fa sms', 'description': 'POST schema for generating a 2fa sms',
'type': 'object', 'type': 'object',
'properties': { 'properties': {

View File

@@ -1,7 +1,7 @@
from app.schema_validation.definitions import uuid from app.schema_validation.definitions import uuid
get_inbound_sms_request = { get_inbound_sms_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "schema for query parameters allowed when getting list of received text messages", "description": "schema for query parameters allowed when getting list of received text messages",
"type": "object", "type": "object",
"properties": { "properties": {
@@ -12,7 +12,7 @@ get_inbound_sms_request = {
get_inbound_sms_single_response = { get_inbound_sms_single_response = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "GET inbound sms schema response", "description": "GET inbound sms schema response",
"type": "object", "type": "object",
"title": "GET response v2/inbound_sms", "title": "GET response v2/inbound_sms",
@@ -36,7 +36,7 @@ get_inbound_sms_single_response = {
} }
get_inbound_sms_response = { get_inbound_sms_response = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "GET list of inbound sms response schema", "description": "GET list of inbound sms response schema",
"type": "object", "type": "object",
"properties": { "properties": {

View File

@@ -7,7 +7,7 @@ from app.models import (
from app.schema_validation.definitions import personalisation, uuid from app.schema_validation.definitions import personalisation, uuid
template = { template = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "template schema", "description": "template schema",
"type": "object", "type": "object",
"title": "notification content", "title": "notification content",
@@ -20,7 +20,7 @@ template = {
} }
notification_by_id = { notification_by_id = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "GET notification response schema", "description": "GET notification response schema",
"type": "object", "type": "object",
"title": "response v2/notification", "title": "response v2/notification",
@@ -32,7 +32,7 @@ notification_by_id = {
get_notification_response = { get_notification_response = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "GET notification response schema", "description": "GET notification response schema",
"type": "object", "type": "object",
"title": "response v2/notification", "title": "response v2/notification",
@@ -67,7 +67,7 @@ get_notification_response = {
} }
get_notifications_request = { get_notifications_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "schema for query parameters allowed when getting list of notifications", "description": "schema for query parameters allowed when getting list of notifications",
"type": "object", "type": "object",
"properties": { "properties": {
@@ -92,7 +92,7 @@ get_notifications_request = {
} }
get_notifications_response = { get_notifications_response = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "GET list of notifications response schema", "description": "GET list of notifications response schema",
"type": "object", "type": "object",
"properties": { "properties": {
@@ -126,7 +126,7 @@ get_notifications_response = {
} }
post_sms_request = { post_sms_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST sms notification schema", "description": "POST sms notification schema",
"type": "object", "type": "object",
"title": "POST v2/notifications/sms", "title": "POST v2/notifications/sms",
@@ -143,7 +143,7 @@ post_sms_request = {
} }
sms_content = { sms_content = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "content schema for SMS notification response schema", "description": "content schema for SMS notification response schema",
"type": "object", "type": "object",
"title": "notification content", "title": "notification content",
@@ -155,7 +155,7 @@ sms_content = {
} }
post_sms_response = { post_sms_response = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST sms notification response schema", "description": "POST sms notification response schema",
"type": "object", "type": "object",
"title": "response v2/notifications/sms", "title": "response v2/notifications/sms",
@@ -172,7 +172,7 @@ post_sms_response = {
post_email_request = { post_email_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST email notification schema", "description": "POST email notification schema",
"type": "object", "type": "object",
"title": "POST v2/notifications/email", "title": "POST v2/notifications/email",
@@ -189,7 +189,7 @@ post_email_request = {
} }
email_content = { email_content = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "Email content for POST email notification", "description": "Email content for POST email notification",
"type": "object", "type": "object",
"title": "notification email content", "title": "notification email content",
@@ -202,7 +202,7 @@ email_content = {
} }
post_email_response = { post_email_response = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST email notification response schema", "description": "POST email notification response schema",
"type": "object", "type": "object",
"title": "response v2/notifications/email", "title": "response v2/notifications/email",
@@ -218,7 +218,7 @@ post_email_response = {
} }
post_letter_request = { post_letter_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST letter notification schema", "description": "POST letter notification schema",
"type": "object", "type": "object",
"title": "POST v2/notifications/letter", "title": "POST v2/notifications/letter",
@@ -232,7 +232,7 @@ post_letter_request = {
} }
post_precompiled_letter_request = { post_precompiled_letter_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST precompiled letter notification schema", "description": "POST precompiled letter notification schema",
"type": "object", "type": "object",
"title": "POST v2/notifications/letter", "title": "POST v2/notifications/letter",
@@ -246,7 +246,7 @@ post_precompiled_letter_request = {
} }
letter_content = { letter_content = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "Letter content for POST letter notification", "description": "Letter content for POST letter notification",
"type": "object", "type": "object",
"title": "notification letter content", "title": "notification letter content",
@@ -258,7 +258,7 @@ letter_content = {
} }
post_letter_response = { post_letter_response = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST sms notification response schema", "description": "POST sms notification response schema",
"type": "object", "type": "object",
"title": "response v2/notifications/letter", "title": "response v2/notifications/letter",

View File

@@ -2,7 +2,7 @@ from app.models import TEMPLATE_TYPES
from app.schema_validation.definitions import personalisation, uuid from app.schema_validation.definitions import personalisation, uuid
get_template_by_id_request = { get_template_by_id_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "schema for parameters allowed when getting template by id", "description": "schema for parameters allowed when getting template by id",
"type": "object", "type": "object",
"properties": { "properties": {
@@ -14,7 +14,7 @@ get_template_by_id_request = {
} }
get_template_by_id_response = { get_template_by_id_response = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "GET template by id schema response", "description": "GET template by id schema response",
"type": "object", "type": "object",
"title": "reponse v2/template", "title": "reponse v2/template",
@@ -42,7 +42,7 @@ get_template_by_id_response = {
} }
post_template_preview_request = { post_template_preview_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST template schema", "description": "POST template schema",
"type": "object", "type": "object",
"title": "POST v2/template/{id}/preview", "title": "POST v2/template/{id}/preview",
@@ -54,7 +54,7 @@ post_template_preview_request = {
} }
post_template_preview_response = { post_template_preview_response = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST template preview schema response", "description": "POST template preview schema response",
"type": "object", "type": "object",
"title": "reponse v2/template/{id}/preview", "title": "reponse v2/template/{id}/preview",

View File

@@ -4,7 +4,7 @@ from app.v2.template.template_schemas import (
) )
get_all_template_request = { get_all_template_request = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "request schema for parameters allowed when getting all templates", "description": "request schema for parameters allowed when getting all templates",
"type": "object", "type": "object",
"properties": { "properties": {
@@ -14,7 +14,7 @@ get_all_template_request = {
} }
get_all_template_response = { get_all_template_response = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "GET response schema when getting all templates", "description": "GET response schema when getting all templates",
"type": "object", "type": "object",
"properties": { "properties": {

View File

@@ -2,7 +2,7 @@ import os
import jsonschema import jsonschema
from flask import json from flask import json
from jsonschema import Draft4Validator from jsonschema import Draft7Validator
def return_json_from_response(response): def return_json_from_response(response):
@@ -22,5 +22,5 @@ def validate_v0(json_to_validate, schema_filename):
def validate(json_to_validate, schema): def validate(json_to_validate, schema):
validator = Draft4Validator(schema) validator = Draft7Validator(schema)
validator.validate(json_to_validate, 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", "description": "GET notification return schema - for email notifications",
"type" : "object", "type" : "object",
"properties": { "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", "description": "GET notification return schema - for sms notifications",
"type" : "object", "type" : "object",
"properties": { "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", "description": "GET notification return schema - for sms notifications",
"type" : "object", "type" : "object",
"properties": { "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", "description": "POST notification return schema - for email notifications",
"type" : "object", "type" : "object",
"properties": { "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", "description": "POST notification return schema - for sms notifications",
"type" : "object", "type" : "object",
"properties": { "properties": {

View File

@@ -1,5 +1,5 @@
{ {
"$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)", "description": "Common definitions - usage example: {'$ref': 'definitions.json#/uuid'} (swap quotes for double quotes)",
"uuid": { "uuid": {
"type": "string", "type": "string",