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

Enable Computer Vision Client to customize endpoint. #3440

Merged
merged 2 commits into from Jul 20, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -8,7 +8,6 @@ nodejs:
package-name: azure-cognitiveservices-computervision
package-version: 2.0.0-preview
output-folder: $(node-sdks-folder)/lib/services/computerVision
override-client-name: ComputerVisionAPIClient
Copy link
Member Author

Choose a reason for hiding this comment

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

Remove "override-client-name" since the Client name now naturally ends with "Client"

azure-arm: false
generate-license-txt: true
generate-package-json: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"swagger": "2.0",
"info": {
"version": "2.0",
"title": "Computer Vision API",
"title": "Computer Vision Client",
"description": "The Computer Vision API provides state-of-the-art algorithms to process images and return information. For example, it can be used to determine if an image contains mature content, or it can be used to find all the faces in an image. It also has other features like estimating dominant and accent colors, categorizing the content of images, and describing an image with complete English sentences. Additionally, it can also intelligently generate images thumbnails for displaying large images effectively."
},
"securityDefinitions": {
Expand All @@ -18,10 +18,11 @@
}
],
"x-ms-parameterized-host": {
"hostTemplate": "{AzureRegion}.api.cognitive.microsoft.com",
"hostTemplate": "{Endpoint}",
"useSchemePrefix": false,
"parameters": [
{
"$ref": "#/parameters/AzureRegion"
"$ref": "#/parameters/Endpoint"
Copy link
Member Author

Choose a reason for hiding this comment

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

Endpoint has to be "$ref", otherwise, it behaves like "x-ms-parameter-location": "method".

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe you'll have to update all the examples, (like this).

Copy link
Member Author

Choose a reason for hiding this comment

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

@cthrash Thanks, didn't know about the examples, they are now updated.

}
]
},
Expand Down Expand Up @@ -1554,32 +1555,14 @@
"format": "file"
}
},
"AzureRegion": {
"name": "AzureRegion",
"description": "Supported Azure regions for Cognitive Services endpoints",
"Endpoint": {
"name": "Endpoint",
"description": "Supported Cognitive Services endpoints",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine for now but would be great if there is a URL in here pointing users to a doc where he/she would be able to get the endpoint.

"x-ms-parameter-location": "client",
"required": true,
"type": "string",
"in": "path",
"x-ms-skip-url-encoding": true,
"x-ms-enum": {
"name": "AzureRegions",
"modelAsString": false
},
"enum": [
"westus",
"westeurope",
"southeastasia",
"eastus2",
"westcentralus",
"westus2",
"eastus",
"southcentralus",
"northeurope",
"eastasia",
"australiaeast",
"brazilsouth"
]
"x-ms-skip-url-encoding": true
}
}
}