You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -179,10 +180,23 @@ To set the `default` for a component of the JSON Schema, the annotation
179
180
"! $default 'value'
180
181
```
181
182
This also ensures that only components whose value is not equal to a specific default value are serialized to the JSON data file.
182
-
Fields, which are not specified in the JSON data file, are deserialized to their default values.
183
+
184
+
Default values can only be specified if one of the following rules apply:
185
+
186
+
1. The default value represents the initial value of the underlying data type (e.g., `0` for an integer or `space` for a character field).
187
+
188
+
2. For enumerations, all other values must **not** represent type initial value of the underlying data type.
189
+
190
+
3. All higher-level structures* of the field are marked as `$required`.
191
+
192
+
> *) Arrays don't need to be marked as `$required` in this case.
193
+
In JSON it is possible to distinguish between empty arrays (`"table": []`) and arrays with "empty" array items (`"table": [{}]`).
194
+
All fields with defaults in the array items that don't follow the other rules, along with their higher-level structures, must be marked as `$required`.
195
+
196
+
Fields that are not specified in the JSON data file are deserialized to their default values.
183
197
Note that if you specify a default value, initial values are written to the JSON data file, unless they are not equal to the selected default.
184
198
185
-
Since fields, which are not specified in the JSON data, might be represented by either initial values or default values, implementations of serialization and deserialization of ABAP file formats must consider fields with default values as specified here.
199
+
Since fields that are not specified in the JSON data might be represented by either initial values or default values, implementations of serialization and deserialization of ABAP file formats must consider fields with default values, as specified here.
186
200
187
201
### Enum Values
188
202
To pass enum values to a JSON Schema, a type and a constant are necessary.
0 commit comments