Skip to content

Commit

Permalink
[Hub Generated] Review request for Microsoft.Azure.Search.Service to …
Browse files Browse the repository at this point in the history
…add version 2017-11-11-preview (Azure#5410)

* [Azure Search] Make connectionString create-only to fix validation warning

This change is just to satisfy Swagger spec validation; It has no effect on
code generation (at least for C#).

* [Azure Search] Fix various Swagger validation errors

This is our first major push towards making searchservice.json pass all
Swagger validation. The validator found several issues that this change
fixes:
  - "Extensible enums" were being modeled incorrectly. On the wire, they
    are just strings, but we were modeling them as objects with a "name"
    property. This reflected the generated code, but not the wire format.
    The solution is to model them as proper enums in the Swagger. This causes
    new validation errors, since these enums should be open-ended, but that's
    an issue with the validator not understanding "extensible enums"; it's
    not a problem with our spec per se.
  - Properties of Skill were marked as "required", when they were being
    omitted or set to null in examples. This is because these properties
    actually appear to be optional from the point of view of the REST API, so
    now we model them as such.
  - "documentdb" was deprecated as a DataSourceType, but not replaced with
    "cosmosdb" in the examples. This is now fixed.
  - The example for "Get Indexer Execution Status" included properties in the
    response that aren't modeled in the Swagger. These properties actually do
    appear on the wire, but they shouldn't and will be removed in a future API
    version. In the meantime, I have removed them from the example.

* [Azure Search] Applying consistent JSON formatting to Swagger spec

* [Azure Search] Make inputs/outputs properties of Skill required

It turns out these properties are required by the API. Also replaced the
deprecated NER skill in examples.

* [Azure Search] Standardize formatting of JSON examples

* [Azure Search] Rolling back NamedEntityRecognition example update

* [Azure Search] Make Swagger spec accurately reflect the semantics of Field

Before this change, the descriptions in the Swagger for the Field type did
not accurately describe the semantics of the Azure Search REST API,
particularly around what the default values of the searchable, filterable,
sortable, and facetable properties were. Instead, they reflected the defaults
of our custom implementation of Field in the .NET SDK.

This change corrects the descriptions to accurately reflect the REST API. It
also adds more detail in anticipation of generating REST API documentation
from the Swagger (which we don't currently do).

A few other changes to Field are related to code generation:
 - Removed the x-ms-external flag so that AutoRest can generate this type.
 - Removed x-nullable: false and x-ms-client-name since they again reflect
   only the custom .NET code and not the desired REST API semantics.
 - Added regex transform rules to readme.md so that we can keep some of our
   custom code for Field in .NET purely for backward compatibility purposes.
   Our intention going forward for other languages is to rely solely on code
   generation for the Field type.
  • Loading branch information
brjohnstmsft authored and jianghaolu committed Mar 20, 2019
1 parent 27af2f4 commit 5cf04ee
Show file tree
Hide file tree
Showing 33 changed files with 1,273 additions and 765 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dataSource": {
"name": "mydocdbdatasource",
"description": "My Cosmos DB data source.",
"type": "documentdb",
"type": "cosmosdb",
"credentials": {
"connectionString": "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId"
},
Expand All @@ -30,7 +30,7 @@
"body": {
"name": "mydocdbdatasource",
"description": "My Cosmos DB data source.",
"type": "documentdb",
"type": "cosmosdb",
"credentials": {
"connectionString": null
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"indexAnalyzer": null,
"searchAnalyzer": null,
"analyzer": "fr.lucene",
"synonymMaps": []
"synonymMaps": []
},
{
"name": "hotelName",
Expand Down Expand Up @@ -286,7 +286,7 @@
"indexAnalyzer": null,
"searchAnalyzer": null,
"analyzer": null,
"synonymMaps": []
"synonymMaps": []
}
],
"scoringProfiles": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@
"searchDnsSuffix": "search.windows.net",
"api-version": "2017-11-11-Preview",
"indexer": {
"name": "myindexer",
"description": "a cool indexer",
"dataSourceName": "mydatasource",
"targetIndexName": "orders",
"name": "myindexer",
"description": "a cool indexer",
"dataSourceName": "mydatasource",
"targetIndexName": "orders",
"schedule": {
"interval": "PT1H",
"startTime": "2015-01-01T00:00:00Z"
},
},
"parameters": {
"maxFailedItems": 10,
"maxFailedItemsPerBatch": 5
}
}
}
},
"responses": {
"201": {
"body": {
"name": "myindexer",
"description": "a cool indexer",
"dataSourceName": "mydatasource",
"targetIndexName": "orders",
"name": "myindexer",
"description": "a cool indexer",
"dataSourceName": "mydatasource",
"targetIndexName": "orders",
"schedule": {
"interval": "PT1H",
"startTime": "2015-01-01T00:00:00Z"
},
},
"parameters": {
"maxFailedItems": 10,
"maxFailedItemsPerBatch": 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dataSource": {
"name": "mydocdbdatasource",
"description": "My Cosmos DB data source.",
"type": "documentdb",
"type": "cosmosdb",
"credentials": {
"connectionString": "AccountEndpoint=https://myDocDbEndpoint.documents.azure.com;AccountKey=myDocDbAuthKey;Database=myDocDbDatabaseId"
},
Expand All @@ -32,7 +32,7 @@
"body": {
"name": "mydocdbdatasource",
"description": "My Cosmos DB data source.",
"type": "documentdb",
"type": "cosmosdb",
"credentials": {
"connectionString": null
},
Expand All @@ -55,7 +55,7 @@
"body": {
"name": "mydocdbdatasource",
"description": "My Cosmos DB data source.",
"type": "documentdb",
"type": "cosmosdb",
"credentials": {
"connectionString": null
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
"indexAnalyzer": null,
"searchAnalyzer": null,
"analyzer": "fr.lucene",
"synonymMaps": []
"synonymMaps": []
},
{
"name": "hotelName",
Expand Down Expand Up @@ -289,7 +289,7 @@
"indexAnalyzer": null,
"searchAnalyzer": null,
"analyzer": null,
"synonymMaps": []
"synonymMaps": []
}
],
"scoringProfiles": [
Expand Down Expand Up @@ -403,7 +403,7 @@
"indexAnalyzer": null,
"searchAnalyzer": null,
"analyzer": "fr.lucene",
"synonymMaps": []
"synonymMaps": []
},
{
"name": "hotelName",
Expand Down Expand Up @@ -515,7 +515,7 @@
"indexAnalyzer": null,
"searchAnalyzer": null,
"analyzer": null,
"synonymMaps": []
"synonymMaps": []
}
],
"scoringProfiles": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@
"api-version": "2017-11-11-Preview",
"Prefer": "return=representation",
"indexer": {
"name": "myindexer",
"description": "a cool indexer",
"dataSourceName": "mydatasource",
"targetIndexName": "orders",
"name": "myindexer",
"description": "a cool indexer",
"dataSourceName": "mydatasource",
"targetIndexName": "orders",
"schedule": {
"interval": "PT1H",
"startTime": "2015-01-01T00:00:00Z"
},
},
"parameters": {
"maxFailedItems": 10,
"maxFailedItemsPerBatch": 5
}
}
}
},
"responses": {
"200": {
"body": {
"name": "myindexer",
"description": "a cool indexer",
"dataSourceName": "mydatasource",
"targetIndexName": "orders",
"name": "myindexer",
"description": "a cool indexer",
"dataSourceName": "mydatasource",
"targetIndexName": "orders",
"schedule": {
"interval": "PT1H",
"startTime": "2015-01-01T00:00:00Z"
},
},
"parameters": {
"maxFailedItems": 10,
"maxFailedItemsPerBatch": 5
Expand All @@ -41,14 +41,14 @@
},
"201": {
"body": {
"name": "myindexer",
"description": "a cool indexer",
"dataSourceName": "mydatasource",
"targetIndexName": "orders",
"name": "myindexer",
"description": "a cool indexer",
"dataSourceName": "mydatasource",
"targetIndexName": "orders",
"schedule": {
"interval": "PT1H",
"startTime": "2015-01-01T00:00:00Z"
},
},
"parameters": {
"maxFailedItems": 10,
"maxFailedItemsPerBatch": 5
Expand Down
Loading

0 comments on commit 5cf04ee

Please sign in to comment.