From 55a356eae967ab6e4f4689330797a94a067dcee3 Mon Sep 17 00:00:00 2001 From: David Tarrant Date: Thu, 13 Jun 2024 09:50:44 +0100 Subject: [PATCH] Updating schemas to hopefully stop AI returning an invalid date --- package.json | 2 +- public/data/schemas/partials/actionPlanning.json | 4 +++- public/data/schemas/partials/completeAssessment.json | 5 +++-- public/data/schemas/partials/riskEvaluation.json | 4 +++- public/data/schemas/partials/unintendedConsequences.json | 4 +++- public/data/schemas/project.json | 4 +++- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 46913fb..12c146c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "care.theodi.org", - "version": "2.6.1", + "version": "2.6.2", "description": "The ODI Care tool (AI enabled)", "main": "index.js", "scripts": { diff --git a/public/data/schemas/partials/actionPlanning.json b/public/data/schemas/partials/actionPlanning.json index 26d64a9..e996b58 100644 --- a/public/data/schemas/partials/actionPlanning.json +++ b/public/data/schemas/partials/actionPlanning.json @@ -42,7 +42,9 @@ }, "date": { "type": "string", - "title": "Date" + "title": "Date", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "Date in the format YYYY-MM-DD" }, "stakeholder": { "type": "string", diff --git a/public/data/schemas/partials/completeAssessment.json b/public/data/schemas/partials/completeAssessment.json index 609b3ca..fe2e045 100644 --- a/public/data/schemas/partials/completeAssessment.json +++ b/public/data/schemas/partials/completeAssessment.json @@ -57,8 +57,9 @@ }, "date": { "type": "string", - "format": "date", - "title": "Date" + "title": "Date", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "Date in the format YYYY-MM-DD" }, "stakeholder": { "type": "string", diff --git a/public/data/schemas/partials/riskEvaluation.json b/public/data/schemas/partials/riskEvaluation.json index 26d64a9..e996b58 100644 --- a/public/data/schemas/partials/riskEvaluation.json +++ b/public/data/schemas/partials/riskEvaluation.json @@ -42,7 +42,9 @@ }, "date": { "type": "string", - "title": "Date" + "title": "Date", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "Date in the format YYYY-MM-DD" }, "stakeholder": { "type": "string", diff --git a/public/data/schemas/partials/unintendedConsequences.json b/public/data/schemas/partials/unintendedConsequences.json index 26d64a9..e996b58 100644 --- a/public/data/schemas/partials/unintendedConsequences.json +++ b/public/data/schemas/partials/unintendedConsequences.json @@ -42,7 +42,9 @@ }, "date": { "type": "string", - "title": "Date" + "title": "Date", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "Date in the format YYYY-MM-DD" }, "stakeholder": { "type": "string", diff --git a/public/data/schemas/project.json b/public/data/schemas/project.json index 0a7e911..59b18cc 100644 --- a/public/data/schemas/project.json +++ b/public/data/schemas/project.json @@ -70,7 +70,9 @@ }, "date": { "type": "string", - "title": "Date" + "title": "Date", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "description": "Date in the format YYYY-MM-DD" }, "stakeholder": { "type": "string",