Skip to content

Commit

Permalink
Update CognitiveService ComputerVision Swagger for new extensions (#1) (
Browse files Browse the repository at this point in the history
Azure#3090)

* Merged PR 17875: Add new languages

Add new languages

Also tidy up the enum definition so that AutoRest generates C# that actually compiles

* Merged PR 17942: Replace fancy quotes with plain single quotes

Make javac compile without complaint even without setting the codepage to utf-8 by dropping the gratuitous typographic quotes.

* Merged PR 17956: Rename url argument for overloaded endpoint to imageUrl

This name will become the name of the argument in Python.  Since you can used named arguments in Python, give them less ambiguous names.

* Changes to make --azure-validator run more cleanly

Errors Fixed
* XmsExamplesRequired/D5001/Documentation (7)
* XmsPathsMustOverloadPaths/R2058/SDKViolation (7)

Errors Ignored
* SecurityDefinitionsStructure/R2054/SDKViolation (1) - API Key scheme for Cognitive Services
* APIVersionPattern/R3012/ARMViolation (1) - Keeping with the Cognitive Services numbering scheme
* OperationsAPIImplementation/R3023/ARMViolation (1) - Not sure what this is

Warnings Fixed
* XmsEnumValidation/R2018/SDKViolation (1)
* DescriptionAndTitleMissing/R4000/SDKViolation (1)

Warnings Ignored
* DescriptionAndTitleMissing/R4000/SDKViolation (35) - description is contained in #ref
* EnumInsteadOfBoolean/R3018/ARMViolation (5) - fix would be a breaking change
* ListInOperationName/R1003/SDKViolation (1) - fix would be a breaking change
* LongRunningOperationsWithLongRunningExtension/R2007/SDKViolation (2) - endpoint will not ultimately yield a 200, as this extension would require
* NonApplicationJsonType/R2004/ARMViolation (15) - fix would be breaking change
* PageableOperation/R2029/SDKViolation (1) - not actually pageable
* ParameterNotDefinedInGlobalParameters/R2015/SDKViolation (1) - All our own parameters specify x-ms-parameter-location
* PostOperationIdContainsUrlVerb/R2066/SDKViolation (7) - fix would be breaking change
  • Loading branch information
cthrash authored and sergey-shandar committed May 23, 2018
1 parent fd4877c commit 0bc2413
Show file tree
Hide file tree
Showing 10 changed files with 452 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
],
"properties": {
"url": {
"description": "Publicly reachable URL of an image",
"type": "string"
}
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"parameters": {
"Content-Type": "application/octet-stream",
"Ocp-Apim-Subscription-Key": "{API key}",
"visualFeatures": "Categories,Adult,Tags,Description,Faces,Color,ImageType",
"details": "Celebrities",
"language": "en",
"body": "{binary}"
},
"responses": {
"200": {
"headers": {},
"body": {
"categories": [
{
"name": "abstract_",
"score": 0.00390625
},
{
"name": "people_",
"score": 0.83984375,
"detail": {
"celebrities": [
{
"name": "Satya Nadella",
"faceRectangle": {
"left": 597,
"top": 162,
"width": 248,
"height": 248
},
"confidence": 0.999028444
}
],
"landmarks": [
{
"name": "Forbidden City",
"confidence": 0.9978346
}
]
}
}
],
"adult": {
"isAdultContent": false,
"isRacyContent": false,
"adultScore": 0.0934349000453949,
"racyScore": 0.068613491952419281
},
"tags": [
{
"name": "person",
"confidence": 0.98979085683822632
},
{
"name": "man",
"confidence": 0.94493889808654785
},
{
"name": "outdoor",
"confidence": 0.938492476940155
},
{
"name": "window",
"confidence": 0.89513939619064331
}
],
"description": {
"tags": [
"person",
"man",
"outdoor",
"window",
"glasses"
],
"captions": [
{
"text": "Satya Nadella sitting on a bench",
"confidence": 0.48293603002174407
}
]
},
"requestId": "0dbec5ad-a3d3-4f7e-96b4-dfd57efe967d",
"metadata": {
"width": 1500,
"height": 1000,
"format": "Jpeg"
},
"faces": [
{
"age": 44,
"gender": "Male",
"faceRectangle": {
"left": 593,
"top": 160,
"width": 250,
"height": 250
}
}
],
"color": {
"dominantColorForeground": "Brown",
"dominantColorBackground": "Brown",
"dominantColors": [
"Brown",
"Black"
],
"accentColor": "873B59",
"isBWImg": false
},
"imageType": {
"clipArtType": 0,
"lineDrawingType": 0
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"parameters": {
"Content-Type": "application/octet-stream",
"Ocp-Apim-Subscription-Key": "{API key}",
"maxCandidates": "1",
"body": "{binary}"
},
"responses": {
"200": {
"body": {
"description": {
"tags": [
"person",
"man",
"outdoor",
"window",
"glasses"
],
"captions": [
{
"text": "Satya Nadella sitting on a bench",
"confidence": 0.48293603002174407
},
{
"text": "Satya Nadella is sitting on a bench",
"confidence": 0.40037006815422832
},
{
"text": "Satya Nadella sitting in front of a building",
"confidence": 0.38035155997373377
}
]
},
"requestId": "ed2de1c6-fb55-4686-b0da-4da6e05d283f",
"metadata": {
"width": 1500,
"height": 1000,
"format": "Jpeg"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parameters": {
"Content-Type": "application/octet-stream",
"Ocp-Apim-Subscription-Key": "{API key}",
"Model": "Celebrities",
"body": "{binary}"
},
"responses": {
"200": {
"body": {
"requestId": "f0027b4b-dc0d-4082-9228-1545ed246b03",
"metadata": {
"width": 1500,
"height": 1000,
"format": "Jpeg"
},
"result": {
"celebrities": [
{
"name": "Satya Nadella",
"faceRectangle": {
"left": 597,
"top": 162,
"width": 248,
"height": 248
},
"confidence": 0.999028444
}
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"parameters": {
"Content-Type": "application/octet-stream",
"Ocp-Apim-Subscription-Key": "{API key}",
"width": "500",
"height": "500",
"smartCropping": true,
"body": "{binary}"
},
"responses": {
"200": {
"headers": {},
"body": "{Binary}"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"parameters": {
"Content-Type": "application/octet-stream",
"Ocp-Apim-Subscription-Key": "{API key}",
"detectOrientation": "true",
"language": "en",
"body": "{binary}"
},
"responses": {
"200": {
"headers": {},
"body": {
"language": "en",
"textAngle": -2.0000000000000338,
"orientation": "Up",
"regions": [
{
"boundingBox": "462,379,497,258",
"lines": [
{
"boundingBox": "462,379,497,74",
"words": [
{
"boundingBox": "462,379,41,73",
"text": "A"
},
{
"boundingBox": "523,379,153,73",
"text": "GOAL"
},
{
"boundingBox": "694,379,265,74",
"text": "WITHOUT"
}
]
},
{
"boundingBox": "565,471,289,74",
"words": [
{
"boundingBox": "565,471,41,73",
"text": "A"
},
{
"boundingBox": "626,471,150,73",
"text": "PLAN"
},
{
"boundingBox": "801,472,53,73",
"text": "IS"
}
]
},
{
"boundingBox": "519,563,375,74",
"words": [
{
"boundingBox": "519,563,149,74",
"text": "JUST"
},
{
"boundingBox": "683,564,41,72",
"text": "A"
},
{
"boundingBox": "741,564,153,73",
"text": "WISH"
}
]
}
]
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"parameters": {
"Content-Type": "application/octet-stream",
"Ocp-Apim-Subscription-Key": "{API key}",
"Handwriting": "true",
"body": "{binary}"
},
"responses": {
"202": {
"header": {
"Operation-Location": "https://{domain}/vision/v1.0/textOperations/49a36324-fc4b-4387-aa06-090cfbf0064f"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"parameters": {
"Content-Type": "application/octet-stream",
"Ocp-Apim-Subscription-Key": "{API key}",
"body": "{binary}"
},
"responses": {
"200": {
"body": {
"tags": [
{
"name": "grass",
"confidence": 0.9999997615814209
},
{
"name": "outdoor",
"confidence": 0.99997067451477051
},
{
"name": "sky",
"confidence": 0.99928975105285645
},
{
"name": "building",
"confidence": 0.99646323919296265
},
{
"name": "house",
"confidence": 0.99279803037643433
},
{
"name": "lawn",
"confidence": 0.82268029451370239
},
{
"name": "green",
"confidence": 0.64122253656387329
},
{
"name": "residential",
"confidence": 0.31403225660324097
}
],
"requestId": "1ad0e45e-b7b4-4be3-8042-53be96103337",
"metadata": {
"width": 400,
"height": 400,
"format": "Jpeg"
}
}
}
}
}

0 comments on commit 0bc2413

Please sign in to comment.