@@ -78,21 +78,34 @@ title = "Contains iterations"
7878# Requirement 2.1: Either a single iteration in variable-based encoding #
7979# ########################################################################
8080
81- [[allOf .oneOf ]]
81+ [allOf .if ]
82+ properties.attributes.properties.iterationEncoding.oneOf = [
83+ { const = { value = " variableBased" , datatype = " STRING" } },
84+ { const = " variableBased" },
85+ ]
86+
87+ [allOf .then ]
8288title = " Variable-based encoding"
8389properties.attributes.properties.iterationEncoding.properties.value = { const = " variableBased" }
8490
85- [allOf .oneOf .properties .data ]
91+ [allOf .then .properties .data ]
8692type = " object"
8793title = " An iteration"
8894description = " A single iteration."
95+
96+ # Only require iteration data if snapshot attribute is defined
97+ [allOf .then .properties .data .if ]
98+ required = [" attributes" ]
99+ properties.attributes.required = [" snapshot" ]
100+
101+ [allOf .then .properties .data .then ]
89102"$ref" = " iteration.json"
90103
91104# ###########################################################################
92105# Requirement 2.2: Or multiple iterations in group- or file-based encoding #
93106# ###########################################################################
94107
95- [[ allOf .oneOf ] ]
108+ [allOf .else ]
96109title = " Group-based (or file-based) encoding"
97110properties.attributes.properties.iterationEncoding.properties.value = { oneOf = [
98111 { const = " groupBased" },
@@ -101,22 +114,22 @@ properties.attributes.properties.iterationEncoding.properties.value = { oneOf =
101114
102115# Base Path
103116
104- [allOf .oneOf .properties .data ]
117+ [allOf .else .properties .data ]
105118type = " object"
106119title = " Base path"
107120description = " A map of all iterations/snapshots in the Series."
108121
109122propertyNames.pattern = " ^(-?[0-9]*|attributes)$"
110123
111- [allOf .oneOf .properties .data .properties ]
124+ [allOf .else .properties .data .properties ]
112125
113- [allOf .oneOf .properties .data .properties .attributes ]
126+ [allOf .else .properties .data .properties .attributes ]
114127title = " Attribute layout"
115128description = " Custom attributes allowed, no required attributes defined."
116129"$ref" = " attributes.json"
117130
118131# Base Path -> Iterations
119132
120- [allOf.oneOf .properties.data.patternProperties."^-?[0-9]*$"]
133+ [allOf.else .properties.data.patternProperties."^-?[0-9]*$"]
121134title = " Iteration"
122135"$ref" = " iteration.json"
0 commit comments