diff --git a/specs/common/schemas/HighlightResult.yml b/specs/common/schemas/HighlightResult.yml index 5ba53cf9ff..8f19c2e7fd 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 df99300e1c..11d3eb3252 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 62ba61dd44..73a1d2d0c8 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'