From 408f57d2d104d482b6237f4d59b8b37ea5eedb55 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 31 Oct 2022 11:10:47 +0100 Subject: [PATCH] fix(rna): date_creation may be null Closes #7975 --- app/schemas/association.json | 12 +++++++++--- spec/lib/api_entreprise/rna_adapter_spec.rb | 1 - 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/schemas/association.json b/app/schemas/association.json index 69daceca5..dd748ca82 100644 --- a/app/schemas/association.json +++ b/app/schemas/association.json @@ -14,8 +14,15 @@ "type": "string" }, "association_date_creation": { - "type": "string", - "format": "date" + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "null" + } + ] }, "association_date_declaration": { "type": "string", @@ -229,7 +236,6 @@ "required": [ "association_titre", "association_rna", - "association_date_creation", "association_date_declaration", "association_date_publication" ] diff --git a/spec/lib/api_entreprise/rna_adapter_spec.rb b/spec/lib/api_entreprise/rna_adapter_spec.rb index b20172751..a992f3a5a 100644 --- a/spec/lib/api_entreprise/rna_adapter_spec.rb +++ b/spec/lib/api_entreprise/rna_adapter_spec.rb @@ -29,7 +29,6 @@ describe APIEntreprise::RNAAdapter do expect(subject["association_rna"]).to eq('W595001988') expect(subject["association_titre"]).to eq('UN SUR QUATRE') expect(subject["association_objet"]).to eq("valoriser, transmettre et partager auprès des publics les plus larges possibles, les bienfaits de l'immigration, la richesse de la diversité et la curiosité de l'autre autrement") - expect(subject["association_date_creation"]).to eq('2014-01-23') expect(subject["association_date_declaration"]).to eq('2014-01-24') expect(subject["association_date_publication"]).to eq('2014-02-08') end