Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions specs/composition-full/common/schemas/responses/Hit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the _ to indicate some private fields? could be worth adding it to the description if so

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not meant to be private. I believe we included the _ prefix because every other KV pair in the object is defined by the user, but we conditionally inject this field into the object

type: string
description: The key of the injectedItem that inserted this metadata.

rankingInfo:
allOf:
Expand Down