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
Copy file name to clipboardExpand all lines: sources/platform/actors/development/actor_definition/input_schema/specification.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -471,9 +471,10 @@ In this example, the object has validation rules for its properties:
471
471
- The `timeout` and `locale` properties are required
472
472
- No additional properties beyond those defined are allowed
473
473
474
-
**Handling default and prefill values for object sub-properties**
474
+
**Handling default and prefill values for object sub-properties:**
475
475
476
476
When defining object with sub-properties, it's possible to set `default` and `prefill` values in two ways:
477
+
477
478
1.**At the parent object level**: You can provide a complete object as the `default` or `prefill` value, which will set values for all sub-properties at once.
478
479
2.**At the individual sub-property level**: You can specify `default` or `prefill` values for each sub-property separately within the `properties` definition.
479
480
@@ -707,9 +708,10 @@ In this example:
707
708
- No additional properties beyond those defined are allowed.
708
709
- The validation of each object item works the same as for a single object field (see [Object fields validation](#object-fields-validation)).
709
710
710
-
**Handling default and prefill values array with object sub-properties**
711
+
**Handling default and prefill values array with object sub-properties:**
711
712
712
713
When defining an array of objects with sub-properties, it's possible to set `default` and `prefill` values in two ways:
714
+
713
715
1.**At the parent array level**: You can provide an array of complete objects as the `default` or `prefill` value, which will be used only if there is no value specified for the field.
714
716
2.**At the individual sub-property level**: You can specify `default` or `prefill` values for each sub-property within the `properties` definition of the object items. These values will be applied to each object in the array value.
715
717
@@ -748,11 +750,13 @@ For example, having an input schema like this:
748
750
```
749
751
750
752
If there is no value specified for the field, the array will default to containing one object:
753
+
751
754
```json
752
755
[
753
756
{ "url": "https://apify.com", "port": 80 }
754
757
]
755
758
```
759
+
756
760
However, if the user adds a new item to the array, the `port` sub-property of that new object will default to `8080`, as defined in the sub-property itself.
0 commit comments