diff --git a/specs/composition-full/common/schemas/components/CompositionBehavior.yml b/specs/composition-full/common/schemas/components/CompositionBehavior.yml index a894dd3567d..dd08596a2d2 100644 --- a/specs/composition-full/common/schemas/components/CompositionBehavior.yml +++ b/specs/composition-full/common/schemas/components/CompositionBehavior.yml @@ -81,6 +81,23 @@ injectedItem: type: integer minimum: 0 maximum: 20 + metadata: + title: injectedItemMetadata + type: object + description: Used to add metadata to the results of the injectedItem. + properties: + hits: + title: injectedItemHitsMetadata + type: object + description: Adds the provided metadata to each injected hit via an `_extra` attribute. + properties: + addItemKey: + type: boolean + description: When true, the `_injectedItemKey` field is set in the `_extra` object of each affected hit. + extra: + type: object + additionalProperties: true + description: The user-defined key-value pairs that will be placed in the `_extra` field of each affected hit. required: - key - source diff --git a/specs/composition-full/common/schemas/responses/Hit.yml b/specs/composition-full/common/schemas/responses/Hit.yml index bbce1eff6b8..25f2b1591c8 100644 --- a/specs/composition-full/common/schemas/responses/Hit.yml +++ b/specs/composition-full/common/schemas/responses/Hit.yml @@ -19,6 +19,17 @@ hit: $ref: '#/rankingInfo' _distinctSeqID: $ref: '../../../../common/schemas/Hit.yml#/distinctSeqID' + _extra: + $ref: '#/hitMetadata' + +hitMetadata: + type: object + description: An object that contains the extra key-value pairs provided in the injectedItem definition. + additionalProperties: true + properties: + _injectedItemKey: + type: string + description: The key of the injectedItem that inserted this metadata. rankingInfo: allOf: