From 64803813bb6e862223bd34ad56d9ad960d564925 Mon Sep 17 00:00:00 2001 From: Thomas Raffray Date: Mon, 16 Sep 2024 16:59:43 +0200 Subject: [PATCH 1/2] fix(specs): update search api specs --- specs/common/schemas/HighlightResult.yml | 24 ++++++++---------------- specs/common/schemas/SearchResponse.yml | 5 ----- specs/common/schemas/SnippetResult.yml | 20 ++++++-------------- 3 files changed, 14 insertions(+), 35 deletions(-) diff --git a/specs/common/schemas/HighlightResult.yml b/specs/common/schemas/HighlightResult.yml index 5ba53cf9ff8..8f19c2e7fd2 100644 --- a/specs/common/schemas/HighlightResult.yml +++ b/specs/common/schemas/HighlightResult.yml @@ -34,25 +34,11 @@ matchLevel: description: Whether the whole query string matches or only a part. enum: [none, partial, full] -highlightResultOptionMap: - type: object - description: Surround words that match the query with HTML tags for highlighting. - additionalProperties: - x-additionalPropertiesName: attribute - $ref: '#/highlightResultOption' - -highlightResultOptionArray: +highlightResultArray: type: array description: Surround words that match the query with HTML tags for highlighting. items: - $ref: '#/highlightResultOption' - -highlightResult: - oneOf: - - $ref: '#/highlightResultMap' - - $ref: '#/highlightResultOption' - - $ref: '#/highlightResultOptionMap' - - $ref: '#/highlightResultOptionArray' + $ref: '#/highlightResult' highlightResultMap: type: object @@ -60,3 +46,9 @@ highlightResultMap: additionalProperties: x-additionalPropertiesName: attribute $ref: '#/highlightResult' + +highlightResult: + oneOf: + - $ref: '#/highlightResultOption' + - $ref: '#/highlightResultMap' + - $ref: '#/highlightResultArray' diff --git a/specs/common/schemas/SearchResponse.yml b/specs/common/schemas/SearchResponse.yml index df99300e1ca..11d3eb3252e 100644 --- a/specs/common/schemas/SearchResponse.yml +++ b/specs/common/schemas/SearchResponse.yml @@ -208,8 +208,3 @@ SearchPagination: $ref: '#/nbPages' hitsPerPage: $ref: './IndexSettings.yml#/hitsPerPage' - required: - - page - - nbHits - - nbPages - - hitsPerPage diff --git a/specs/common/schemas/SnippetResult.yml b/specs/common/schemas/SnippetResult.yml index 62ba61dd447..73a1d2d0c88 100644 --- a/specs/common/schemas/SnippetResult.yml +++ b/specs/common/schemas/SnippetResult.yml @@ -13,29 +13,21 @@ snippetResultOption: x-discriminator-fields: - matchLevel -snippetResultOptionMap: +snippetResultMap: type: object description: Snippets that show the context around a matching search query. additionalProperties: x-additionalPropertiesName: attribute - $ref: '#/snippetResultOption' + $ref: '#/snippetResult' -snippetResultOptionArray: +snippetResultArray: type: array description: Snippets that show the context around a matching search query. items: - $ref: '#/snippetResultOption' + $ref: '#/snippetResult' snippetResult: oneOf: - - $ref: '#/snippetResultMap' - $ref: '#/snippetResultOption' - - $ref: '#/snippetResultOptionMap' - - $ref: '#/snippetResultOptionArray' - -snippetResultMap: - type: object - description: Snippets that show the context around a matching search query. - additionalProperties: - x-additionalPropertiesName: attribute - $ref: '#/snippetResult' + - $ref: '#/snippetResultMap' + - $ref: '#/snippetResultArray' From 065b093aede93566b5c36d35d1eee2b3edb7639d Mon Sep 17 00:00:00 2001 From: Thomas Raffray Date: Mon, 16 Sep 2024 17:42:13 +0200 Subject: [PATCH 2/2] chore: empty commit