Skip to content

Commit 94b9ff7

Browse files
committed
fix run param injectedItems
1 parent 048474b commit 94b9ff7

File tree

3 files changed

+34
-35
lines changed

3 files changed

+34
-35
lines changed

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

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,32 +29,38 @@ ruleContexts:
2929
- Rules
3030

3131
injectedItems:
32-
type: array
33-
items:
32+
type: object
33+
additionalProperties:
3434
$ref: '#/externalInjectedItem'
3535
description: |
36-
A list of injected objectIDs into an external source.
37-
default: []
38-
example:
39-
[{'objectID': 'my-object-1', 'metadata': {'my-field': 'my-value'}}]
36+
A list of extenrally injected objectID groups into from an external source.
37+
default: {}
38+
# example: {"my-injection-group": {"items": [{"objectID": "my-object"}]}}
4039
x-categories:
4140
- Advanced
4241

4342
externalInjectedItem:
4443
type: object
4544
properties:
46-
objectID:
47-
type: string
48-
metadata:
49-
type: object
50-
additionalProperties: true
51-
description: |
52-
User-defined key-values that will be added to the injected item in the response.
53-
This is identical to Hits metadata defined in Composition or Composition Rule,
54-
with the benefit of being set at runtime.
55-
example: {'my-field': 'my-value'}
56-
required:
57-
- objectID
58-
description: |
59-
An objectID injected into an external source.
60-
example: {'objectID': 'my-object-1', 'metadata': {'my-field': 'my-value'}}
45+
items:
46+
type: array
47+
items:
48+
title: externalInjectedItemsArray
49+
type: object
50+
additionalProperties: false
51+
properties:
52+
objectID:
53+
type: string
54+
description: An objectID injected into an external source.
55+
metadata:
56+
type: object
57+
additionalProperties: true
58+
description: |
59+
User-defined key-values that will be added to the injected item in the response.
60+
This is identical to Hits metadata defined in Composition or Composition Rule,
61+
with the benefit of being set at runtime.
62+
example: {'my-field': 'my-value'}
63+
required:
64+
- objectID
65+
example:
66+
{'objectID': 'my-object-1', 'metadata': {'my-field': 'my-value'}}

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,6 @@ injectedItem:
8888
- length
8989

9090
injectedItemSource:
91-
type: object
92-
additionalProperties: false
93-
properties:
94-
search:
95-
$ref: './InjectionSource.yml#/search'
96-
external:
97-
$ref: './InjectionSource.yml#/external'
9891
oneOf:
99-
- required: [search]
100-
- required: [external]
92+
- $ref: './InjectionSource.yml#/SearchSource'
93+
- $ref: './InjectionSource.yml#/ExternalSource'

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
search:
2-
title: injectedItemSearchSource
1+
SearchSource:
2+
title: search
33
description: Injected items will originate from a search request performed on the specified index.
44
type: object
55
additionalProperties: false
@@ -13,13 +13,13 @@ search:
1313
required:
1414
- index
1515

16-
external:
17-
title: injectedItemExternalSource
16+
ExternalSource:
17+
title: external
1818
description: Injected items will originate from externally provided objectIDs (that must exist in the index) given at runtime in the run request payload.
1919
type: object
2020
additionalProperties: false
2121
allOf:
22-
- $ref: '#/search'
22+
- $ref: '#/SearchSource'
2323
- $ref: '#/externalFields'
2424

2525
externalFields:

0 commit comments

Comments
 (0)