From 0059bdde3c89c0f9e7da9460190cd128457e33a6 Mon Sep 17 00:00:00 2001 From: Vidushi-GitHub Date: Fri, 22 Sep 2023 16:44:29 -0400 Subject: [PATCH 1/5] reference as string instead of number --- gcn/notices/core/FollowUp.schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcn/notices/core/FollowUp.schema.json b/gcn/notices/core/FollowUp.schema.json index d030b137..e91258ff 100644 --- a/gcn/notices/core/FollowUp.schema.json +++ b/gcn/notices/core/FollowUp.schema.json @@ -19,8 +19,8 @@ }, "reference": { "type": "object", - "additionalProperties": { "type": "number" }, - "description": "Reference as distributed by the notices or circulars or ATel, ex. gcn.notices.Fermi.gbm.alert: 4642" + "additionalProperties": { "type": "string" }, + "description": "Reference as distributed by the notices or circulars or ATel, ex. gcn circulars: 12345, gcn.notices.LVK.alert: SYYMMDDak-2-preliminary" } } } From 4b569149fee7da4fbc5866f19ecbd49b8b703d77 Mon Sep 17 00:00:00 2001 From: Vidushi-GitHub Date: Fri, 22 Sep 2023 16:53:45 -0400 Subject: [PATCH 2/5] reference as string instead of number --- gcn/notices/icecube/LvkNuTrackSearch.example.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcn/notices/icecube/LvkNuTrackSearch.example.json b/gcn/notices/icecube/LvkNuTrackSearch.example.json index 3f144282..fbd8861c 100644 --- a/gcn/notices/icecube/LvkNuTrackSearch.example.json +++ b/gcn/notices/icecube/LvkNuTrackSearch.example.json @@ -1,7 +1,7 @@ { "$schema": "https://gcn.nasa.gov/schema/main/gcn/notices/icecube/LvkNuTrackSearch.schema.json", "type": "IceCube LVK Alert Nu Track Search", - "reference": { "gcn.notices.LVK.alert": 4642 }, + "reference": { "gcn.notices.LVK.alert": "4642" }, "ref_ID": "MS230427r", "alert_datetime": "2023-04-16T05:32:29.55Z", "trigger_time": "2023-04-16T05:22:26.0Z", From 3a02254ee5884d9ec513d765b8ba443007b16ed8 Mon Sep 17 00:00:00 2001 From: Vidushi-GitHub Date: Fri, 22 Sep 2023 17:07:31 -0400 Subject: [PATCH 3/5] number to union --- gcn/notices/core/FollowUp.schema.json | 2 +- gcn/notices/icecube/LvkNuTrackSearch.example.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcn/notices/core/FollowUp.schema.json b/gcn/notices/core/FollowUp.schema.json index e91258ff..9ef5add4 100644 --- a/gcn/notices/core/FollowUp.schema.json +++ b/gcn/notices/core/FollowUp.schema.json @@ -19,7 +19,7 @@ }, "reference": { "type": "object", - "additionalProperties": { "type": "string" }, + "additionalProperties": { "type": ["number", "string"] }, "description": "Reference as distributed by the notices or circulars or ATel, ex. gcn circulars: 12345, gcn.notices.LVK.alert: SYYMMDDak-2-preliminary" } } diff --git a/gcn/notices/icecube/LvkNuTrackSearch.example.json b/gcn/notices/icecube/LvkNuTrackSearch.example.json index fbd8861c..3f144282 100644 --- a/gcn/notices/icecube/LvkNuTrackSearch.example.json +++ b/gcn/notices/icecube/LvkNuTrackSearch.example.json @@ -1,7 +1,7 @@ { "$schema": "https://gcn.nasa.gov/schema/main/gcn/notices/icecube/LvkNuTrackSearch.schema.json", "type": "IceCube LVK Alert Nu Track Search", - "reference": { "gcn.notices.LVK.alert": "4642" }, + "reference": { "gcn.notices.LVK.alert": 4642 }, "ref_ID": "MS230427r", "alert_datetime": "2023-04-16T05:32:29.55Z", "trigger_time": "2023-04-16T05:22:26.0Z", From 1c2ad01e975891eeb4b26060d4cc5797b8f9f796 Mon Sep 17 00:00:00 2001 From: Vidushi-GitHub Date: Fri, 22 Sep 2023 17:14:33 -0400 Subject: [PATCH 4/5] fix validate --- validate.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/validate.mjs b/validate.mjs index 835b3a78..575225ef 100644 --- a/validate.mjs +++ b/validate.mjs @@ -4,7 +4,11 @@ import addFormats from 'ajv-formats' import meta from 'ajv/dist/refs/json-schema-2020-12/index.js' import { glob as baseGlob } from 'glob' -const ajv = new Ajv({ validateSchema: true, verbose: true }) +const ajv = new Ajv({ + validateSchema: true, + verbose: true, + allowUnionTypes: true, +}) addFormats(ajv) ajv.addMetaSchema(meta) From 3e1e56c2070346abab441ace1b452284422bdbc4 Mon Sep 17 00:00:00 2001 From: Vidushi Sharma <103223246+Vidushi-GitHub@users.noreply.github.com> Date: Fri, 22 Sep 2023 17:23:32 -0400 Subject: [PATCH 5/5] Update gcn/notices/core/FollowUp.schema.json --- gcn/notices/core/FollowUp.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcn/notices/core/FollowUp.schema.json b/gcn/notices/core/FollowUp.schema.json index 9ef5add4..773353de 100644 --- a/gcn/notices/core/FollowUp.schema.json +++ b/gcn/notices/core/FollowUp.schema.json @@ -20,7 +20,7 @@ "reference": { "type": "object", "additionalProperties": { "type": ["number", "string"] }, - "description": "Reference as distributed by the notices or circulars or ATel, ex. gcn circulars: 12345, gcn.notices.LVK.alert: SYYMMDDak-2-preliminary" + "description": "Reference as distributed by the notices or circulars or ATel, ex. gcn circulars: 12345, gcn.notices.LVK.alert: SYYMMDDak-2-preliminary. " } } }