Skip to content

Commit fb31043

Browse files
committed
address CR
1 parent f413af7 commit fb31043

File tree

1 file changed

+19
-29
lines changed
  • sources/platform/actors/development/actor_definition/input_schema

1 file changed

+19
-29
lines changed

sources/platform/actors/development/actor_definition/input_schema/specification.md

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -415,21 +415,19 @@ Properties:
415415

416416
#### Object fields validation
417417

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+
419420
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`.
420421

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.
423423

424-
:::note
424+
:::note Recursive nesting
425425

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.
427427

428428
:::
429429

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"
433431
{
434432
"title": "Configuration",
435433
"type": "object",
@@ -471,12 +469,12 @@ In this example, the object has validation rules for its properties:
471469
- The `timeout` and `locale` properties are required
472470
- No additional properties beyond those defined are allowed
473471

474-
**Handling default and prefill values for object sub-properties:**
472+
##### Handling default and prefill values for object sub-properties
475473

476474
When defining object with sub-properties, it's possible to set `default` and `prefill` values in two ways:
477475

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.
480478

481479
When both methods are used, the values defined at the parent object level take precedence over those defined at the sub-property level.
482480
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
524522
It renders all properties based on their type (and optionally the `editor` field), making it ideal for visually managing complex object structures.
525523
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.
526524

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"
530526
{
531527
"title": "Configuration",
532528
"type": "object",
@@ -569,7 +565,7 @@ Each sub-property is rendered with its own input field according to its type and
569565
- The `timeout` property is rendered as a numeric input with validation limits.
570566
- The `debugMode` property is rendered as a checkbox toggle.
571567

572-
**Limitations:**
568+
##### Limitations
573569

574570
The `schemaBased` editor supports only **top-level sub-properties** (level 1 nesting).
575571
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
662658
If the item type is an `object`, it can define its own `properties`, `required`, and `additionalProperties` fields,
663659
working in the same way as a single object field (see [Object fields validation](#object-fields-validation)).
664660

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.
666662
Array items can themselves be objects with sub-schemas, and objects within objects, recursively, without any limit on nesting depth.
667663

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"
671665
{
672666
"title": "Request Headers",
673667
"type": "array",
@@ -708,12 +702,12 @@ In this example:
708702
- No additional properties beyond those defined are allowed.
709703
- The validation of each object item works the same as for a single object field (see [Object fields validation](#object-fields-validation)).
710704

711-
**Handling default and prefill values array with object sub-properties:**
705+
##### Handling default and prefill values array with object sub-properties
712706

713707
When defining an array of objects with sub-properties, it's possible to set `default` and `prefill` values in two ways:
714708

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.
717711

718712
For example, having an input schema like this:
719713

@@ -766,9 +760,7 @@ It works for arrays of primitive types (like strings or numbers) as well as arra
766760

767761
This makes it easy to manage complex arrays in the UI while still enforcing validation rules defined in the items field.
768762

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"
772764
{
773765
"title": "Start URLs",
774766
"type": "array",
@@ -791,9 +783,7 @@ Rendered input:
791783
- The array must contain between 1 and 50 items.
792784
- Duplicate values are not allowed.
793785

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"
797787
{
798788
"title": "Request Headers",
799789
"type": "array",
@@ -832,7 +822,7 @@ Rendered input:
832822
- Validation ensures all required sub-properties are filled and no extra properties are allowed.
833823
- New items can be added up to the `maxItems` limit, and each item is validated individually.
834824

835-
**Limitations:**
825+
##### Limitations
836826

837827
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.
838828

0 commit comments

Comments
 (0)