Azure / Azure/azure-rest-api-specs
[Search] Answers Should be Defined as a String, Not an Enum
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 6k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
The `Answers` definition, both the [SearchOptions query parameters](https://github.com/Azure/azure-rest-api-specs/blob/master/specification/search/data-plane/Azure.Search/preview/2020-06-30-Preview/searchindex.json#L313) and [SearchRequest JSON property](https://github.com/Azure/azure-rest-api-specs/blob/master/specification/search/data-plane/Azure.Search/preview/2020-06-30-Preview/searchindex.json#L1434), should be redefined as just a `string` type and not an `enum` type.
The reason for this is that with the current definition these will only be able to support passing the defined enum value, currently `none` or `extractive`, and won't be able to support passing the additional `count-<# of answers>` modifier to change the search from only returning a single answers for each one ([documentation for the search request](https://docs.microsoft.com/en-us/rest/api/searchservice/preview-api/search-documents#query-parameters)).
Contributor guide
Research direction
Open specification/search/data-plane/Azure.Search/preview/2020-06-30-Preview/searchindex.json at the SearchOptions query parameter near line 313 and the SearchRequest property near line 1434. Change both Answers definitions from enum to string, then verify that the specification permits the documented count-<# of answers> modifier as well as the existing values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json, openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100