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
+19-29Lines changed: 19 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -415,21 +415,19 @@ Properties:
415
415
416
416
#### Object fields validation
417
417
418
-
In the same way as in the root-level input schema, a schema can be defined for sub-properties of an object using the `properties` field.
418
+
Like root-level input schemas, you can define a schema for sub-properties of an object using the `properties` field.
419
+
419
420
Each sub-property within this sub-schema can define the same fields as those available at the root level of the input schema, except for the fields that apply only at the root level: `sectionCaption` and `sectionDescription`.
420
421
421
-
Validation is performed both in the UI and during actor execution via the API.
422
-
Sub-schema validation works independently of the editor selected for the parent object. It also respects the `additionalProperties` and `required` fields, allowing precise control over whether properties not defined in `properties` are permitted and which properties are mandatory.
422
+
Validation is performed both in the UI and during Actor execution via the API. Sub-schema validation works independently of the editor selected for the parent object. It also respects the `additionalProperties` and `required` fields, giving you precise control over whether properties not defined in `properties` are permitted and which properties are mandatory.
423
423
424
-
:::note
424
+
:::note Recursive nesting
425
425
426
-
Object sub-properties can also define their own sub-schemas recursively, without any limit on the nesting depth.
426
+
Object sub-properties can define their own sub-schemas recursively with no nesting depth limit.
427
427
428
428
:::
429
429
430
-
Example of an object property with sub-schema properties:
431
-
432
-
```json
430
+
```json title="Example of an object property with sub-schema properties"
433
431
{
434
432
"title": "Configuration",
435
433
"type": "object",
@@ -471,12 +469,12 @@ In this example, the object has validation rules for its properties:
471
469
- The `timeout` and `locale` properties are required
472
470
- No additional properties beyond those defined are allowed
473
471
474
-
**Handling default and prefill values for object sub-properties:**
472
+
##### Handling default and prefill values for object sub-properties
475
473
476
474
When defining object with sub-properties, it's possible to set `default` and `prefill` values in two ways:
477
475
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.
479
-
2.**At the individual sub-property level**: You can specify `default` or `prefill` values for each sub-property separately within the `properties` definition.
476
+
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.
477
+
2._At the individual sub-property level_: You can specify `default` or `prefill` values for each sub-property separately within the `properties` definition.
480
478
481
479
When both methods are used, the values defined at the parent object level take precedence over those defined at the sub-property level.
482
480
For example, in the input schema like this:
@@ -524,9 +522,7 @@ Objects with a defined sub-schema can use the `schemaBased` editor, which provid
524
522
It renders all properties based on their type (and optionally the `editor` field), making it ideal for visually managing complex object structures.
525
523
This editor supports both single objects and arrays of objects (see [below](#array)), allowing each property to be represented with an appropriate input field in the UI.
526
524
527
-
Example of updated previous field using the `schemaBased` editor:
528
-
529
-
```json
525
+
```json title="Example of an object property with sub-schema properties using schemaBased editor"
530
526
{
531
527
"title": "Configuration",
532
528
"type": "object",
@@ -569,7 +565,7 @@ Each sub-property is rendered with its own input field according to its type and
569
565
- The `timeout` property is rendered as a numeric input with validation limits.
570
566
- The `debugMode` property is rendered as a checkbox toggle.
571
567
572
-
**Limitations:**
568
+
##### Limitations
573
569
574
570
The `schemaBased` editor supports only **top-level sub-properties** (level 1 nesting).
575
571
While deeper nested properties can still define sub-schemas for validation, they cannot use the `schemaBased` editor for rendering.
@@ -662,12 +658,10 @@ Each array item is validated according to its `type` and inside the `items` fiel
662
658
If the item type is an `object`, it can define its own `properties`, `required`, and `additionalProperties` fields,
663
659
working in the same way as a single object field (see [Object fields validation](#object-fields-validation)).
664
660
665
-
Validation is performed both in the UI and during actor execution via the API.
661
+
Validation is performed both in the UI and during Actor execution via the API.
666
662
Array items can themselves be objects with sub-schemas, and objects within objects, recursively, without any limit on nesting depth.
667
663
668
-
Example of an array of objects property with sub-schema:
669
-
670
-
```json
664
+
```json title="Example of an array of objects property with sub-schema"
671
665
{
672
666
"title": "Request Headers",
673
667
"type": "array",
@@ -708,12 +702,12 @@ In this example:
708
702
- No additional properties beyond those defined are allowed.
709
703
- The validation of each object item works the same as for a single object field (see [Object fields validation](#object-fields-validation)).
710
704
711
-
**Handling default and prefill values array with object sub-properties:**
705
+
##### Handling default and prefill values array with object sub-properties
712
706
713
707
When defining an array of objects with sub-properties, it's possible to set `default` and `prefill` values in two ways:
714
708
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.
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.
709
+
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.
710
+
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.
717
711
718
712
For example, having an input schema like this:
719
713
@@ -766,9 +760,7 @@ It works for arrays of primitive types (like strings or numbers) as well as arra
766
760
767
761
This makes it easy to manage complex arrays in the UI while still enforcing validation rules defined in the items field.
768
762
769
-
Example 1: Array of strings using the `schemaBased` editor:
770
-
771
-
```json
763
+
```json title="Example of an array of strings property with sub-schema"
772
764
{
773
765
"title": "Start URLs",
774
766
"type": "array",
@@ -791,9 +783,7 @@ Rendered input:
791
783
- The array must contain between 1 and 50 items.
792
784
- Duplicate values are not allowed.
793
785
794
-
Example 2: Array of objects using the `schemaBased` editor:
795
-
796
-
```json
786
+
```json title="Example of an array of objects property with sub-schema"
797
787
{
798
788
"title": "Request Headers",
799
789
"type": "array",
@@ -832,7 +822,7 @@ Rendered input:
832
822
- Validation ensures all required sub-properties are filled and no extra properties are allowed.
833
823
- New items can be added up to the `maxItems` limit, and each item is validated individually.
834
824
835
-
**Limitations:**
825
+
##### Limitations
836
826
837
827
As with objects, the sub-schema feature for arrays only works for level 1 sub-properties. While the objects in the array can have properties with their own schema definitions, those properties cannot themselves use the `schemaBased` editor.
0 commit comments