Closed duncandewhurst closed 1 year ago
Confirming I'm happy with this, on the understanding it has no real bearing on how we use the JSON file - if we want 1 component we can still remove the others, if we want to include >1 component we still can. Go ahead.
That's correct @stufraser1. I'll wait for @matamadio to confirm he's happy before making the changes.
Yes, fine with these changes.
Presently, the schema has a top-level
anyOf
containing objects for each component:hazard
,exposure
,vulnerability
andloss
.This use of
anyOf
isn't compatible with Flatten Tool so in order to generate the spreadsheet template shared in https://github.com/GFDRR/rdls-spreadsheet-template/issues/1, I had to pre-process the schema to move the properties for each component into the top-levelproperties
key. Using ananyOf
like this is also likely to present problems for error messages in CoVE because of the way the underlying JSON Schema validation library works.Therefore, I think that we should move the properties for each component into the top-level properties key. Since the property names in each
anyOf
item are distinct and optional, this change will make no difference to the structure or validity of RDLS data from a publisher or user perspective, it is only a matter of how we organise the schema.I also noticed that the
type
keyword is missing from each ofhazard
,exposure
,vulnerability
andloss
so we can add that in when making the above changes.I've sketched out how this would look from a schema perspective below. @stufraser1 @matamadio please could you confirm that you're happy with this change?
cc @odscjames @radix0000 for awareness of schema changes.
Current model
Proposed model