Skip to content

Commit e0441d1

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

File tree

3 files changed

+33
-35
lines changed

3 files changed

+33
-35
lines changed

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

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,32 +29,37 @@ 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: {}
4038
x-categories:
4139
- Advanced
4240

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