From 4a286424720646479c0b071102e5b045c1b5217c Mon Sep 17 00:00:00 2001 From: Jack Wilsdon Date: Tue, 19 Sep 2023 14:16:21 +0100 Subject: [PATCH] Add type for highlight field --- openapi.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/openapi.yml b/openapi.yml index edd68b0..6099f47 100644 --- a/openapi.yml +++ b/openapi.yml @@ -1462,7 +1462,12 @@ components: highlight: type: object description: Highlighted version of the matching document - additionalProperties: true + additionalProperties: + oneOf: + - $ref: "#/components/schemas/SearchHighlightV2" + - type: array + items: + $ref: "#/components/schemas/SearchHighlightV2" document: type: object description: Can be any key-value pair @@ -1534,6 +1539,27 @@ components: items: type: object x-go-type: "interface{}" + SearchHighlightV2: + type: object + required: + - snippet + - matched_tokens + properties: + snippet: + type: string + description: The highlighted snippet + example: Stark Industries + value: + type: string + description: Full field value with highlighting + example: Stark Industries is a major supplier of space equipment. + matched_tokens: + type: array + description: The matching tokens in the field value + items: + type: string + example: + - Stark SearchOverrideSchema: type: object required: