-
Notifications
You must be signed in to change notification settings - Fork 28
refactor(specs): re-organise response for Composition API #5744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+180
−101
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
specs/composition/common/schemas/responses/runResponseComponents/CompositionsRunSection.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # Schema for the compositions section in a composition run response. | ||
| # { | ||
| # ... | ||
| # "compositions": { | ||
| # "run": [ | ||
| # { | ||
| # "objectID": "comp1765458818347", | ||
| # "appliedRules": [ | ||
| # { | ||
| # "objectID": "cr-1765458959657" | ||
| # } | ||
| # ] | ||
| # } | ||
| # ] | ||
| # } | ||
| # } | ||
|
|
||
| compositionBaseSearchResponse: | ||
| type: object | ||
| properties: | ||
| compositions: | ||
| $ref: '#/compositionsSearchResponse' | ||
|
|
||
| compositionsSearchResponse: | ||
| type: object | ||
| additionalProperties: true | ||
| properties: | ||
| run: | ||
| type: array | ||
| items: | ||
| $ref: '#/compositionRunSearchResponse' | ||
| required: | ||
| - run | ||
|
|
||
| compositionRunSearchResponse: | ||
| type: object | ||
| additionalProperties: true | ||
| properties: | ||
| objectID: | ||
| type: string | ||
| description: The objectID of the composition which generated this result set. | ||
| appliedRules: | ||
| type: array | ||
| items: | ||
| $ref: '#/compositionRunAppliedRules' | ||
| example: {objectID: 'comp1765458818347', appliedRules: [{objectID: 'cr-1765458959657'}]} | ||
| required: | ||
| - objectID | ||
|
|
||
| compositionRunAppliedRules: | ||
gavinwade12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| type: object | ||
| properties: | ||
| objectID: | ||
| type: string | ||
| description: The objectID of the applied composition rule on this query. | ||
| example: | ||
| objectID: 'cr-1765458959657' | ||
| required: | ||
| - objectID | ||
180 changes: 120 additions & 60 deletions
180
specs/composition/common/schemas/responses/runResponseComponents/SingleResultSet.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,97 +1,157 @@ | ||
| # Schema for a single result set in a composition run response. | ||
| # { | ||
| # "results": [ | ||
| # { | ||
| # "hits": [ | ||
| # { ... }, | ||
| # { ... } | ||
| # ], | ||
| # "compositions": { | ||
| # "comp1765458818347": { | ||
| # "injectedItems": [ | ||
| # { | ||
| # "key": "men-sponsored-group", | ||
| # "appliedRules": [ | ||
| # { | ||
| # "objectID": "qr-1765459001234" | ||
| # } | ||
| # ], | ||
| # "aiReRanking": { # Not described in the client | ||
| # "reRankingActivated": true, # at the moment | ||
| # "persoImpactInsideActivationWindow": false | ||
| # } | ||
| # } | ||
| # ] | ||
| # } | ||
| # } | ||
| # }, | ||
| # ... | ||
| # ], | ||
| # ... | ||
| # } | ||
|
|
||
| searchResultsItem: | ||
| allOf: | ||
| - $ref: '../../../../../common/schemas/SearchResponse.yml#/baseSearchResponse' | ||
| - $ref: '#/SearchPagination' | ||
| - $ref: '#/searchHits' | ||
| - $ref: '#/SearchFields' | ||
| - $ref: '#/resultsCompositionsResponse' | ||
|
|
||
| SearchPagination: | ||
| SearchFields: | ||
| type: object | ||
| additionalProperties: false | ||
| properties: | ||
| page: | ||
| type: integer | ||
| description: The current page of the results. | ||
| example: 0 | ||
| hits: | ||
| $ref: '#/hits' | ||
| hitsPerPage: | ||
| $ref: '#/hitsPerPage' | ||
| nbHits: | ||
| type: integer | ||
| description: Number of results (hits). | ||
| example: 20 | ||
| $ref: '#/nbHits' | ||
| nbPages: | ||
| type: integer | ||
| description: Number of pages of results. | ||
| example: 1 | ||
| hitsPerPage: | ||
| type: integer | ||
| description: Number of hits returned per page. | ||
| example: 20 | ||
| $ref: '#/nbPages' | ||
| page: | ||
| $ref: '#/page' | ||
| params: | ||
| $ref: '#/params' | ||
| query: | ||
| $ref: '#/query' | ||
| required: | ||
| - page | ||
| - nbHits | ||
| - nbPages | ||
| - hitsPerPage | ||
|
|
||
| searchHits: | ||
| type: object | ||
| additionalProperties: true | ||
| properties: | ||
| hits: | ||
| type: array | ||
| description: | | ||
| Search results (hits). | ||
| Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting. | ||
| items: | ||
| $ref: 'Hit.yml#/hit' | ||
| query: | ||
| type: string | ||
| description: The search query string. | ||
| example: shoes | ||
| params: | ||
| type: string | ||
| description: URL-encoded string of all search parameters. | ||
| example: query=a&hitsPerPage=20 | ||
| required: | ||
| - hits | ||
| - query | ||
| - params | ||
|
|
||
| # ###################### | ||
| # # Search Properties ## | ||
| # ###################### | ||
|
|
||
| page: | ||
| type: integer | ||
| description: The current page of the results. | ||
| example: 0 | ||
|
|
||
| nbHits: | ||
| type: integer | ||
| description: Number of results (hits). | ||
| example: 20 | ||
|
|
||
| nbPages: | ||
| type: integer | ||
| description: Number of pages of results. | ||
| example: 1 | ||
|
|
||
| hitsPerPage: | ||
| type: integer | ||
| description: Number of hits returned per page. | ||
| example: 20 | ||
|
|
||
| hits: | ||
| type: array | ||
| description: | | ||
| Search results (hits). | ||
| Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting. | ||
| items: | ||
| $ref: 'Hit.yml#/hit' | ||
|
|
||
| query: | ||
| type: string | ||
| description: The search query string. | ||
| example: shoes | ||
|
|
||
| params: | ||
| type: string | ||
| description: URL-encoded string of all search parameters. | ||
| example: query=a&hitsPerPage=20 | ||
|
|
||
| # ############################ | ||
| # # Composition Properties ## | ||
| # ########################### | ||
|
|
||
| resultsCompositionsResponse: | ||
| type: object | ||
| additionalProperties: true | ||
| properties: | ||
| compositions: | ||
| title: resultsCompositionsInfoResponse | ||
| type: object | ||
| additionalProperties: | ||
| title: resultsCompositionInfoResponse | ||
| x-additionalPropertiesName: composition-id | ||
| type: object | ||
| properties: | ||
| injectedItems: | ||
| type: array | ||
| items: | ||
| $ref: '#/resultsInjectedItemInfoResponse' | ||
| required: | ||
| - injectedItems | ||
| $ref: '#/resultsCompositionInfoResponse' | ||
| required: | ||
| - compositions | ||
|
|
||
| resultsCompositionInfoResponse: | ||
| type: object | ||
| x-additionalPropertiesName: composition-id | ||
| properties: | ||
| injectedItems: | ||
| type: array | ||
| items: | ||
| $ref: '#/resultsInjectedItemInfoResponse' | ||
| required: | ||
| - injectedItems | ||
|
|
||
| resultsInjectedItemInfoResponse: | ||
| type: object | ||
| additionalProperties: true | ||
| properties: | ||
| key: | ||
| type: string | ||
| description: The key of the injected group. | ||
| example: 'men-sponsored-group' | ||
| appliedRules: | ||
| type: array | ||
| items: | ||
| title: resultsInjectedItemAppliedRulesInfoResponse | ||
| type: object | ||
| properties: | ||
| objectID: | ||
| $ref: '../../../../../common/parameters.yml#/objectID' | ||
| required: | ||
| - objectID | ||
| $ref: '#/resultsInjectedItemAppliedRulesInfoResponse' | ||
| required: | ||
| - key | ||
|
|
||
| resultsInjectedItemAppliedRulesInfoResponse: | ||
| type: object | ||
| properties: | ||
| objectID: | ||
| type: string | ||
| description: The objectID of the applied index level rule on this injected group. | ||
| example: | ||
| objectID: 'qr-1765458959657' | ||
| required: | ||
| - key | ||
| - objectID |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.