From c772cab278020a395d522609e4d2199c238abf7d Mon Sep 17 00:00:00 2001 From: Richard Hallett Date: Mon, 20 Nov 2023 10:37:00 +0100 Subject: [PATCH] Allow valueUri to be null Allow json schema validation to accept null --- app/models/schemas/client/subjects.json | 7 ++++++- spec/requests/repositories_spec.rb | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/models/schemas/client/subjects.json b/app/models/schemas/client/subjects.json index 8ece1f194..b45fff165 100644 --- a/app/models/schemas/client/subjects.json +++ b/app/models/schemas/client/subjects.json @@ -7,7 +7,12 @@ "properties": { "classificationCode": { "type": "string" }, "schemeUri": { "type": "string" }, - "valueUri": { "type": "string" }, + "valueUri": { + "type": [ + "string", + "null" + ] + }, "lang": { "type": "string" }, "subject": { "type": "string" }, "subjectScheme": { "type": "string" } diff --git a/spec/requests/repositories_spec.rb b/spec/requests/repositories_spec.rb index 374841395..9429eb6a6 100644 --- a/spec/requests/repositories_spec.rb +++ b/spec/requests/repositories_spec.rb @@ -405,6 +405,7 @@ "schemeUri" => "http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E", "subjectScheme" => "FOR", "lang" => "en", + "valueUri" => nil, "classificationCode" => "001" }] end let(:update_attributes) do @@ -437,6 +438,7 @@ "schemeUri" => "http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E", "subject" => "80505 Web Technologies (excl. Web Search)", "subjectScheme" => "FOR", + "valueUri" => nil, "classificationCode" => "001" } ])