Skip to content

Commit 99f8174

Browse files
authored
feat(specs): add fields for metadata in composition injectedItems (#5241)
1 parent c393d37 commit 99f8174

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

specs/composition-full/common/schemas/components/CompositionBehavior.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,23 @@ injectedItem:
8181
type: integer
8282
minimum: 0
8383
maximum: 20
84+
metadata:
85+
title: injectedItemMetadata
86+
type: object
87+
description: Used to add metadata to the results of the injectedItem.
88+
properties:
89+
hits:
90+
title: injectedItemHitsMetadata
91+
type: object
92+
description: Adds the provided metadata to each injected hit via an `_extra` attribute.
93+
properties:
94+
addItemKey:
95+
type: boolean
96+
description: When true, the `_injectedItemKey` field is set in the `_extra` object of each affected hit.
97+
extra:
98+
type: object
99+
additionalProperties: true
100+
description: The user-defined key-value pairs that will be placed in the `_extra` field of each affected hit.
84101
required:
85102
- key
86103
- source

specs/composition-full/common/schemas/responses/Hit.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ hit:
1919
$ref: '#/rankingInfo'
2020
_distinctSeqID:
2121
$ref: '../../../../common/schemas/Hit.yml#/distinctSeqID'
22+
_extra:
23+
$ref: '#/hitMetadata'
24+
25+
hitMetadata:
26+
type: object
27+
description: An object that contains the extra key-value pairs provided in the injectedItem definition.
28+
additionalProperties: true
29+
properties:
30+
_injectedItemKey:
31+
type: string
32+
description: The key of the injectedItem that inserted this metadata.
2233

2334
rankingInfo:
2435
allOf:

0 commit comments

Comments
 (0)