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

ComputerVision - collection of fixes #3145

Merged
merged 1 commit into from
Jun 5, 2018
Merged
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 @@ -326,16 +326,10 @@
"in": "path",
"description": "The domain-specific content to recognize.",
"required": true,
"type": "string",
"x-nullable": false,
"x-ms-enum": {
"name": "DomainModels",
"modelAsString": false
},
"enum": [
"Celebrities",
"Landmarks"
]
"type": "string"
},
Copy link
Member

Choose a reason for hiding this comment

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

Any specific reason to use raw string instead of enum? Are we are doing this to ensure customer can use SDK with content values those are not listed as known enum values (Celebrities, Landmarks)? If yes, then we could simply change "modelAsString": false to "modelAsString": true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Today we only have two custom (domain) models, but we want to reserve the right to add one without requiring a client SDK refresh. There's a method (/model) that will return the permissible values. Note that the hand-crafted version only takes a string.

{
"$ref": "#/parameters/ServiceLanguage"
},
{
"$ref": "../../../Common/Parameters.json#/parameters/ImageUrl"
Expand Down Expand Up @@ -663,6 +657,9 @@
"application/json"
],
"parameters": [
{
"$ref": "#/parameters/ServiceLanguage"
},
{
"$ref": "../../../Common/Parameters.json#/parameters/ImageStream"
}
Expand Down Expand Up @@ -707,6 +704,9 @@
"required": true,
"type": "string"
},
{
"$ref": "#/parameters/ServiceLanguage"
},
{
"$ref": "../../../Common/Parameters.json#/parameters/ImageStream"
}
Expand Down Expand Up @@ -895,7 +895,8 @@
"type": "object",
"properties": {
"language": {
"$ref": "#/definitions/OcrResult"
"type": "string",
"description": "The BCP-47 language code of the text in the image."
Copy link
Member

Choose a reason for hiding this comment

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

is this a breaking change in the server side? i.e. returning string instead of complex type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No the server for this type is unchanged for 2+ years. The swagger was just wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A bit of background - up to now most of our customers have been using a hand-built .net client SDK. We're bringing the swagger to par so that this will be the official package source moving forward.

Copy link
Member

Choose a reason for hiding this comment

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

@cthrash thank you Chris for clarifying.

},
"textAngle": {
"type": "number",
Expand Down Expand Up @@ -997,7 +998,8 @@
"properties": {
"result": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/DomainModelResult"
"type": "object",
"description": "Model-specific response"
},
"requestId": {
"type": "string",
Expand All @@ -1008,15 +1010,53 @@
}
}
},
"DomainModelResult": {
"CelebrityResults": {
"type": "object",
"description": "List of celebrities recognized in the image.",
"properties": {
"celebrities": {
"type": "array",
"description": "An array of possible celebritied identified in the image.",
"items": {
"$ref": "#/definitions/CelebritiesModel"
}
},
"requestId": {
"type": "string",
"description": "Id of the REST API request."
},
"metadata": {
"$ref": "#/definitions/ImageMetadata"
}
}
},
"LandmarkResults": {
"type": "object",
"description": "List of landmarks recognized in the image.",
"properties": {
"landmarks": {
"type": "array",
"items": {
"type": "object",
"description": "A landmark recognized in the image",
"properties": {
"name": {
"type": "string",
"description": "Name of the landmark."
},
"confidence": {
"type": "number",
"format": "double",
"description": "Confidence level for the landmark recognition."
}
}
}
},
"requestId": {
"type": "string",
"description": "Id of the REST API request."
},
"metadata": {
"$ref": "#/definitions/ImageMetadata"
}
}
},
Expand Down