Skip to content

Commit b3d2e24

Browse files
committed
reuse metadata from source
1 parent d58c58f commit b3d2e24

File tree

2 files changed

+20
-25
lines changed

2 files changed

+20
-25
lines changed

specs/composition-full/common/params/Composition.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,9 @@ externalInjectedItem:
4646
objectID:
4747
type: string
4848
metadata:
49-
$ref: '#/injectedItemMetadata'
49+
$ref: '../schemas/components/CompositionBehavior.yml#/metadata'
5050
description: |
5151
An objectID injected into an external source.
5252
required:
5353
- objectID
5454
example: {'objectID': 'my-object-1', 'metadata': {'my-field': 'my-value'}}
55-
56-
injectedItemMetadata:
57-
type: object
58-
additionalProperties: true
59-
description: |
60-
User defined key-values that will be added to injected item in the response.
61-
This is identical to Hits metadata which is defined in Composition or Composition Rule, with the benefit of being set at runtime.
62-
example: {'my-value': 'my-field'}

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

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,7 @@ injectedItem:
6565
minimum: 0
6666
maximum: 20
6767
metadata:
68-
title: injectedItemMetadata
69-
type: object
70-
description: Used to add metadata to the results of the injectedItem.
71-
properties:
72-
hits:
73-
title: injectedItemHitsMetadata
74-
type: object
75-
description: Adds the provided metadata to each injected hit via an `_extra` attribute.
76-
properties:
77-
addItemKey:
78-
type: boolean
79-
description: When true, the `_injectedItemKey` field is set in the `_extra` object of each affected hit.
80-
extra:
81-
type: object
82-
additionalProperties: true
83-
description: The user-defined key-value pairs that will be placed in the `_extra` field of each affected hit.
68+
$ref: '#/metadata'
8469
required:
8570
- key
8671
- source
@@ -91,3 +76,21 @@ injectionSource:
9176
oneOf:
9277
- $ref: './InjectionSource.yml#/search'
9378
- $ref: './InjectionSource.yml#/external'
79+
80+
metadata:
81+
title: injectedItemMetadata
82+
type: object
83+
description: Used to add metadata to the results of the injectedItem.
84+
properties:
85+
hits:
86+
title: injectedItemHitsMetadata
87+
type: object
88+
description: Adds the provided metadata to each injected hit via an `_extra` attribute.
89+
properties:
90+
addItemKey:
91+
type: boolean
92+
description: When true, the `_injectedItemKey` field is set in the `_extra` object of each affected hit.
93+
extra:
94+
type: object
95+
additionalProperties: true
96+
description: The user-defined key-value pairs that will be placed in the `_extra` field of each affected hit.

0 commit comments

Comments
 (0)