Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Search] Rename types for better SDK code #16039

Merged
merged 12 commits into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@
"lexicon"
],
"x-ms-enum": {
"name": "Speller",
"name": "QuerySpellerType",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Type add anything to this name? Most enums are better without an extra Type at the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right - in our discussion we only decided on QueryAnswerType rename for the Answers parameter.
We have 3 params that are similar in nature and usage and it would be good to keep them consistently named - Speller->QuerySpellerType, Answers->QueryAnswerType and Captions->QueryCaptionType - all extensible enums.

One pro of adding the suffix Type is that the param can otherwise be misunderstood as containing part of a result object. It is best illustrated for QueryAnswer and QueryCaption. We could leave the third as QuerySpeller or tack on Type there too to make all 3 names closely grouped.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tg-msft - what do you think?
Also, do you know how should I go forward with this PR with the validation errors regarding changes in an existing swagger? Do I need to send an email, or can I tag folks here?

"modelAsString": true,
"values": [
{
Expand All @@ -1479,7 +1479,7 @@
"extractive"
],
"x-ms-enum": {
"name": "Answers",
"name": "QueryAnswerType",
Mohit-Chakraborty marked this conversation as resolved.
Show resolved Hide resolved
"modelAsString": true,
"values": [
{
Expand All @@ -1503,7 +1503,7 @@
"extractive"
],
"x-ms-enum": {
"name": "Captions",
"name": "QueryCaptionType",
"modelAsString": true,
"values": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,10 +500,10 @@
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/DisableCacheReprocessingChangeDetectionParameter"
"$ref": "#/parameters/IgnoreResetRequirementsParameter"
},
{
"$ref": "#/parameters/IgnoreResetRequirementsParameter"
"$ref": "#/parameters/DisableCacheReprocessingChangeDetectionParameter"
}
],
"x-ms-request-id": "request-id",
Expand Down Expand Up @@ -814,10 +814,10 @@
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/DisableCacheReprocessingChangeDetectionParameter"
"$ref": "#/parameters/IgnoreResetRequirementsParameter"
},
{
"$ref": "#/parameters/IgnoreResetRequirementsParameter"
"$ref": "#/parameters/DisableCacheReprocessingChangeDetectionParameter"
}
],
"x-ms-request-id": "request-id",
Expand Down Expand Up @@ -10033,6 +10033,7 @@
},
"IgnoreResetRequirementsParameter": {
"name": "ignoreResetRequirements",
"x-ms-client-name": "skipIndexerResetRequirementForCache",
"in": "query",
"required": false,
"type": "boolean",
Expand Down