Beta
Optional
Beta
excludeOptional
Beta
includeBy default, all children up to target.maxPathDepth
are included.
When include
is specified, only segments explicitly listed will be included.
Fields or array items not on the include list, are implicitly excluded.
Optional
Beta
maxmaxPathDepth controls how deep into the schema from the target root the instruction will affect.
Depth is based on path segments:
title
has depth 1array[_key="no"].title
has depth 3Be careful not to set this too high in studios with recursive document schemas, as it could have negative impact on performance; both for runtime and quality of responses.
Default: 4
Optional
Beta
operationSets the default operation for all paths in the target.
Generate runs in 'mixed'
operation mode by default:
Changes are set in all non-array fields, and append to all array fields.
'set'
– an overwriting operation, and replaces the full field value.'append'
:
– array fields: appends new items to the end of the array,
'mixed'
– (default) sets non-array fields, and appends to array fieldsThe default operation can be overridden on a per-path basis using include
.
Nested fields inherit the operation specified by their parent and falls back to the top level target operation if not otherwise specified.
Use include
to change the operation
of individual fields or items.
target: {path: ['array'], operation: 'append'}
will append the output of the instruction to the end of the array.
To insert in the middle of the array, use target: {path: ['array', {_key: 'appendAfterKey'}], operation: 'append'}
.
Here, the output of the instruction will be appended after the array item with key 'appendAfterKey'
.
Optional
Beta
pathRoot target path.
Use this to have the instruction only affect a part of the document.
To further control the behavior of individual paths under the root, use include
, exclude
, types.include
and types.exclude
.
Example:
path: ['body', {_key: 'someKey'}, 'nestedObject']
Here, the instruction will only write to fields under the nestedObject.
Default: [] = the document itself
Optional
Beta
typesTypes can be used to exclude array item types or all fields directly under the target path of a certain type. If you do exclude: ['string'] all string fields under the target will be excluded, for instance.
types.include
and types.exclude
are mutually exclusive.
By default, all children up to
target.maxPathDepth
are included. Fields or array items not on the exclude list, are implicitly included.