autorest.azure-functions-cs.../samples/CognitiveSearch
Michael Yanni 02f8d9e404 Fix concat order as to be the same as it was previously. 2020-02-27 15:57:25 -08:00
..
CognitiveSearch Fix concat order as to be the same as it was previously. 2020-02-27 15:57:25 -08:00
Demo Add a CognitiveSearch sample (#418) 2020-01-23 13:41:37 -08:00
readme.md Add a CognitiveSearch sample (#418) 2020-01-23 13:41:37 -08:00
searchindex.json Add a CognitiveSearch sample (#418) 2020-01-23 13:41:37 -08:00
searchservice.json Add a CognitiveSearch sample (#418) 2020-01-23 13:41:37 -08:00

readme.md

CognitiveSearch

AutoRest Configuration

see https://aka.ms/autorest

title: CognitiveServices
require: $(this-folder)/../readme.samples.md
# https://github.com/Azure/azure-rest-api-specs/blob/master/specification/search/data-plane/Microsoft.Azure.Search.Data/stable/2019-05-06/searchindex.json
# https://github.com/Azure/azure-rest-api-specs/blob/master/specification/search/data-plane/Microsoft.Azure.Search.Service/stable/2019-05-06/searchservice.json
input-file:
    - $(this-folder)/searchindex.json
    - $(this-folder)/searchservice.json
namespace: Azure.CognitiveSearch

Swagger tweaks to get things working

The swagger uses { type: "number", format: "int64" } but it should be { type: "integer", format: "int64" } per https://swagger.io/docs/specification/data-models/data-types/#numbers.

directive:
- from: swagger-document
  where: $..properties[*]
  transform: >
    if ($.format === "int64") { $.type = "integer"; }
    return $;    

The swagger and the codegen both use the name request which is problematic.

directive:
- from: swagger-document
  where: $.paths["/indexes('{indexName}')/search.analyze"].post.parameters[1]
  transform: >
    $["x-ms-client-name"] = "request_todo";
    return $;