openapi-directory
Version:
Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS
1 lines • 22.1 kB
JSON
{"openapi":"3.0.0","info":{"description":"The service is used to perform ink layout and recognition of written words and shapes. Ink strokes passed to the service are recognized and organized into recognition results in the response","title":"Ink Recognizer Client","version":"1.0","x-apisguru-categories":["cloud"],"x-logo":{"url":"https://assets.onestore.ms/cdnfiles/onestorerolling-1606-01000/shell/v3/images/logo/microsoft.png"},"x-origin":[{"format":"swagger","url":"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/cognitiveservices/data-plane/InkRecognizer/preview/v1.0/InkRecognizer.json","version":"2.0"}],"x-providerName":"azure.com","x-serviceName":"cognitiveservices-InkRecognizer","x-tags":["Azure","Microsoft"]},"security":[{"apim_key":[]}],"paths":{"/recognize":{"put":{"description":"Ink Recognition operation is used to perform ink layout and recognition of written words and shapes. It allows passing the ink strokes to the service to get the recognition results in the response.","operationId":"InkRecognizer_Recognize","parameters":[{"description":"The request id used to uniquely identify each request during troubleshooting. This is an optional parameter useful for correlating logs and other artifacts.","in":"header","name":"x-ms-client-request-id","required":false,"x-ms-client-request-id":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/analysisRequest"}}},"description":"The collection of stroke objects to send for analysis","required":true},"responses":{"200":{"description":"The results were processed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/analysisResponse"},"examples":{"Identify a word written in ink":{"$ref":"#/components/examples/Identify_a_word_written_in_ink"}}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorModel"}}}}},"tags":["InkRecognizer"]}}},"servers":[{"url":"https://azure.local"},{"url":"https://{Endpoint}/inkrecognizer/v1.0-preview","variables":{"Endpoint":{"description":"Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).","x-ms-parameter-location":"client","x-ms-skip-url-encoding":true,"default":"none"}}}],"components":{"examples":{"Identify_a_word_written_in_ink":{"value":{"recognitionUnits":[{"alternates":[{"category":"inkWord","recognizedString":"defaults"},{"category":"inkWord","recognizedString":"defiant"},{"category":"inkWord","recognizedString":"defaulter"},{"category":"inkWord","recognizedString":"default's"},{"category":"inkWord","recognizedString":"defaults'"},{"category":"inkWord","recognizedString":"defaulted"},{"category":"inkWord","recognizedString":"descant"},{"category":"inkWord","recognizedString":"decant"},{"category":"inkWord","recognizedString":"defat"}],"boundingRectangle":{"height":43.88999938964844,"topX":6.909999847412109,"topY":9.960000038146973,"width":84.87999725341797},"category":"inkWord","class":"leaf","id":4,"parentId":3,"recognizedText":"default","rotatedBoundingRectangle":[{"x":3.180000066757202,"y":15.670000076293945},{"x":89.41999816894531,"y":3.3299999237060547},{"x":95.43000030517578,"y":45.33000183105469},{"x":9.1899995803833,"y":57.66999816894531}],"strokeIds":[1,2]},{"alternates":[{"category":"inkWord","recognizedString":"defaults"},{"category":"inkWord","recognizedString":"defiant"},{"category":"inkWord","recognizedString":"defaulter"},{"category":"inkWord","recognizedString":"default's"},{"category":"inkWord","recognizedString":"defaults'"},{"category":"inkWord","recognizedString":"defaulted"},{"category":"inkWord","recognizedString":"descant"},{"category":"inkWord","recognizedString":"decant"},{"category":"inkWord","recognizedString":"defat"}],"boundingRectangle":{"height":43.88999938964844,"topX":6.909999847412109,"topY":9.960000038146973,"width":84.87999725341797},"category":"line","childIds":[4],"class":"container","id":3,"parentId":2,"recognizedText":"default","rotatedBoundingRectangle":[{"x":3.180000066757202,"y":15.670000076293945},{"x":89.41999816894531,"y":3.3299999237060547},{"x":95.43000030517578,"y":45.33000183105469},{"x":9.1899995803833,"y":57.66999816894531}],"strokeIds":[1,2]},{"boundingRectangle":{"height":43.88999938964844,"topX":6.909999847412109,"topY":9.960000038146973,"width":84.87999725341797},"category":"paragraph","childIds":[3],"class":"container","id":2,"parentId":1,"rotatedBoundingRectangle":[{"x":3.180000066757202,"y":15.670000076293945},{"x":89.41999816894531,"y":3.3299999237060547},{"x":95.43000030517578,"y":45.33000183105469},{"x":9.1899995803833,"y":57.66999816894531}],"strokeIds":[1,2]},{"boundingRectangle":{"height":43.88999938964844,"topX":6.909999847412109,"topY":9.960000038146973,"width":84.87999725341797},"category":"writingRegion","childIds":[2],"class":"container","id":1,"parentId":0,"rotatedBoundingRectangle":[{"x":3.180000066757202,"y":15.670000076293945},{"x":89.41999816894531,"y":3.3299999237060547},{"x":95.43000030517578,"y":45.33000183105469},{"x":9.1899995803833,"y":57.66999816894531}],"strokeIds":[1,2]},{"boundingRectangle":{"height":43.88999938964844,"topX":6.909999847412109,"topY":9.960000038146973,"width":84.87999725341797},"category":"root","childIds":[1],"class":"container","id":0,"parentId":-1,"rotatedBoundingRectangle":[{"x":6.909999847412109,"y":9.960000038146973},{"x":91.7899957275305,"y":9.960000038146973},{"x":6.909999847412109,"y":53.84999393463135},{"x":91.78999572753905,"y":53.84999393463135}],"strokeIds":[1,2]}]}}},"parameters":{"Endpoint":{"description":"Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).","in":"path","name":"Endpoint","required":true,"x-ms-parameter-location":"client","x-ms-skip-url-encoding":true,"schema":{"type":"string"}}},"securitySchemes":{"apim_key":{"in":"header","name":"Ocp-Apim-Subscription-Key","type":"apiKey"}},"schemas":{"alternatePattern":{"description":"The list of alternates for the core recognition result. In case of handwriting related recognition units, this list includes other words that are close possibilities to the results provided as 'recognizedText'.","items":{"properties":{"category":{"$ref":"#/components/schemas/leafCategoryPattern"},"confidence":{"description":"A number between 0 and 1 which indicates the confidence level in the result","type":"number"},"points":{"description":"Array of point objects that represent points that are relevant to the type of recognition unit. For example, for leaf node of inkDrawing category that represents a triangle, points would include the x,y coordinates of the vertices of the recognized triangle. The points represent the coordinates of points used to create the perfectly drawn shape that is closest to the original input. They may not exactly match.","items":{"$ref":"#/components/schemas/pointDetailsPattern"},"type":"array"},"recognizedString":{"description":"The recognized string from an inkWord or the name of a recognized shape in an inkDrawing object","type":"string"},"rotationAngle":{"description":"The angular orientation of an object relative to the horizontal axis","type":"number"}},"required":["category","recognizedString"],"type":"object"},"type":"array"},"analysisRequest":{"description":"This shows the expected contents of a request","properties":{"applicationType":{"description":"This describes the domain of the client application","enum":["drawing","writing","mixed"],"type":"string","x-ms-enum":{"modelAsString":true,"name":"application"}},"inkPointValueAttributes":{"items":{"$ref":"#/components/schemas/inkPointValueAttribute"},"type":"array"},"inputDeviceKind":{"description":"This identifies the kind of device used as the writing instrument","enum":["digitizer","pen","lightPen","touchScreen","touchPad","whiteBoard","3dDigitizer","stereoPlotter","articulatedArm","armature"],"type":"string","x-ms-enum":{"modelAsString":true,"name":"inputDevice"}},"language":{"description":"The IETF BCP 47 language code (for ex. en-US, en-GB, hi-IN etc.) of the expected language for the handwritten content in the ink strokes. The response will include results from this language.","example":"en-US","type":"string"},"strokes":{"description":"This is the array of strokes sent for recognition. Best results are produced when the order of strokes added in the array matches the order in which the user created them. Changing the stroke order may produce unexpected results.","items":{"$ref":"#/components/schemas/stroke"},"type":"array"},"unit":{"description":"This is the physical unit of the ink strokes. It is up to the application developer to decide how to convert the device specific units to physical units before calling the service. The conversion factor can be different based on the type of the device used.","enum":["mm","cm","in"],"type":"string","x-ms-enum":{"modelAsString":true,"name":"unit"}},"unitMultiple":{"description":" This is a scaling factor to be applied to the point coordinates when interpreting them in the physical units specified.","type":"number"}},"required":["strokes","language"],"type":"object"},"analysisResponse":{"description":"This shows the expected contents of a response from the service","properties":{"language":{"description":"This is the language used for recognizing handwriting from the ink strokes in the request.","type":"string"},"recognitionUnits":{"$ref":"#/components/schemas/recognitionUnit"},"unit":{"description":"This is the physical unit of the ink strokes. It is up to the application developer to decide how to convert the device specific units to physical units before calling the service. The conversion factor can be different based on the type of the device used.","enum":["mm","cm","in"],"type":"string","x-ms-enum":{"modelAsString":true,"name":"unit"}},"unitMultiple":{"description":" This is a scaling factor to be applied to the point coordinates when interpreting them in the physical units specified.","type":"number"}},"required":["recognitionUnits"],"type":"object"},"categoryPattern":{"description":"The category of a recognition unit represents the type of content for that unit.","enum":["root","writingRegion","paragraph","line","inkBullet","inkDrawing","inkWord","unknown"],"type":"string","x-ms-enum":{"modelAsString":true,"name":"category"}},"classPattern":{"description":"The class represents the type of the recognition unit. A recognition unit can be a leaf node or a container node. Container nodes typically have leaf nodes as children.","enum":["container","leaf"],"type":"string"},"containerCategoryPattern":{"description":"The category of recognition units that represent types that have children recognition units.","enum":["root","writingRegion","paragraph","line"],"type":"string","x-ms-enum":{"modelAsString":true,"name":"container"}},"drawingAttributesPattern":{"description":"The properties to use when rendering ink","properties":{"color":{"description":"This shows the components of the color in rgba format","properties":{"a":{"description":"The alpha component of the color","type":"number"},"b":{"description":"The blue component of the color","type":"number"},"g":{"description":"The green component of the color","type":"number"},"r":{"description":"The red component of the color","type":"number"}},"type":"object"},"fitToCurve":{"description":" This indicates whether Bezier smoothing is used to render the stroke","type":"boolean"},"height":{"description":"The height of the stylus used to draw the stroke","type":"number"},"ignorePressure":{"description":" This indicates whether the thickness of a rendered Stroke changes according the amount of pressure applied.","type":"boolean"},"rasterOp":{"enum":["noOperation","copyPen","maskPen"],"type":"string","x-ms-enum":{"modelAsString":true,"name":"rasterOp"}},"tip":{"description":"This specifies the tip to be used to draw a stroke","enum":["ellipse","rectangle"],"type":"string","x-ms-enum":{"modelAsString":true,"name":"tip"}},"width":{"description":"The width of the stylus used to draw the stroke","type":"number"}},"type":"object"},"errorModel":{"properties":{"code":{"description":"This represents the error code","type":"string"},"details":{"description":"This gives details of the reason(s) for the error","items":{"properties":{"code":{"description":"This represents the error code","type":"string"},"message":{"description":"This represents the error message","type":"string"},"target":{"description":"This represents the target of the error message","type":"string"}}},"type":"array"},"message":{"description":"This represents the error message","type":"string"},"target":{"description":"This represents the target of the error message","type":"string"}},"required":["code","message"],"type":"object"},"inkPoint":{"description":"An object containing the properties of an point in the path of an ink stroke. The main properties are the x and y values. Other include tip pressure, x tilt etc. For the coordinate values, it is recommended to have a precision of 8 digits after the decimal to obtain most accurate recognition results. The origin (0,0) of the canvas is assumed to be at the top left corner of the canvas","properties":{"barrelPressure":{"description":"The force exerted directly by the user on a transducer sensor, such as a pressure-sensitive button on the barrel of a stylus. This may not be used for recognition.","type":"number"},"barrelSwitch":{"description":"A non-tip button located on the barrel of a stylus. Its function is typically mapped to a system secondary button. This may not be used for recognition.","type":"boolean"},"eraser":{"description":"The control is used for erasing objects. It is typically located opposite the writing end of a stylus. This may not be used for recognition.","type":"boolean"},"height":{"description":"The height of the tip of the writing instrument. This is used by touch screen devices to report the height of the finger contact on the writing surface. This may not be used for recognition.","type":"number"},"inverted":{"description":"A value that indicates that the currently sensed position originates from the end of a stylus opposite the tip switch. This may not be used for recognition.","type":"boolean"},"secondaryTip":{"description":"A secondary switch used in conjunction with the tip switch to indicate pressure above a certain threshold applied with the stylus. This may not be used for recognition.","type":"boolean"},"timestamp":{"description":"The time relative to the absolute time the transducer last became active. This may not be used for recognition.","type":"number"},"tipPressure":{"description":"The force exerted against the tablet surface by the transducer, typically a stylus. This may not be used for recognition.","type":"number"},"tipSwitch":{"description":"A switch located on the tip of a stylus indicating contact of the stylus with a surface. This may not be used for recognition.","type":"boolean"},"width":{"description":"The width of the tip of the writing instrument. This is used by touch screen devices to report the width of the finger contact on the writing surface. This may not be used for recognition.","type":"number"},"x":{"description":"The x coordinate of the pen location on the writing surface.","type":"number"},"xTilt":{"description":"The plane angle between the Y-Z plane and the plane containing the transducer axis and the Y axis. This may not be used for recognition.","type":"number"},"y":{"description":"The y coordinate of the pen location on the writing surface.","type":"number"},"yTilt":{"description":"The angle between the X-Z and transducer-X planes. A positive Y Tilt is toward the user. This may not be used for recognition.","type":"number"},"z":{"description":"The z coordinate of the pen location on the writing space. This may not be used for recognition.","type":"number"}},"required":["x","y"],"type":"object"},"inkPointValueAttribute":{"description":"A container for the attributes of a value contained in the ink point object.","properties":{"logicalMaximum":{"description":"The maximum value for the attribute","type":"number"},"logicalMinimum":{"description":"The minimum value for the attribute","type":"number"},"name":{"description":"The name of the point attribute.","type":"string"}},"type":"object"},"leafCategoryPattern":{"description":"The category of recognition units that represent types that don't have children recognition units.","enum":["inkDrawing","inkBullet","inkWord","unknown"],"type":"string","x-ms-enum":{"modelAsString":true,"name":"leaf"}},"pointDetailsPattern":{"description":"This holds all the properties of one point","properties":{"x":{"description":"This represents the x coordinate of the point","type":"number"},"y":{"description":"This represents the y coordinate of the point","type":"number"}},"required":["x","y"],"type":"object"},"recognitionUnit":{"description":"The list of recognition units based on the analysis of the ink strokes.","items":{"description":"This identifies the recognized entity","properties":{"alternates":{"$ref":"#/components/schemas/alternatePattern"},"boundingRectangle":{"description":"The bounding rectangle of the recognition unit represented by the coordinates of the top left corner (topX,topY) along with width and height of the rectangle. Note that this rectangle is not rotated. So for rotated objects such as slanted handwriting, it will cover the entire object. The unit will be matched to the one specified in the original request (mm by default.) ","properties":{"height":{"description":"The is the height of the bounding rectangle","type":"number"},"topX":{"description":"This is the top left x coordinate","type":"number"},"topY":{"description":"This is the top left y coordinate","type":"number"},"width":{"description":"This is width of the bounding rectangle","type":"number"}},"type":"object"},"category":{"$ref":"#/components/schemas/categoryPattern"},"center":{"$ref":"#/components/schemas/pointDetailsPattern"},"childIds":{"description":"An array of integers representing the identifier of each child of the current recognition unit.","items":{"type":"integer"},"type":"array"},"class":{"$ref":"#/components/schemas/classPattern"},"confidence":{"description":"A number between 0 and 1 which indicates the confidence level in the result.","type":"number"},"id":{"description":"The identifier of the recognition unit. This id is used to indicate parent/child relationship between different recognition units.","type":"integer"},"parentId":{"description":"The id of the parent node in the tree structure of the recognition results. parent = 0 indicates that there is no dedicated parent node for this unit.","type":"integer"},"points":{"description":"Array of point objects that represent points that are relevant to the type of recognition unit. For example, for a leaf node of inkDrawing category that represents a triangle, points would include the x, y coordinates of the vertices of the recognized triangle. The points represent the coordinates used to create the perfectly drawn shape that is closest to the original input. They may not exactly match.","items":{"$ref":"#/components/schemas/pointDetailsPattern"},"type":"array"},"recognizedObject":{"$ref":"#/components/schemas/shapePattern"},"recognizedText":{"description":"The string contains the text that was recognized. It can be an empty string if the recognizer cannot determine the text.","type":"string"},"rotatedBoundingRectangle":{"description":"This is the rotated bounding rectangle that covers the entire recognized object along the angle of rotation of the object. Note that this is NOT the same as rotating the boundingRectangle by the rotation angle.","items":{"$ref":"#/components/schemas/pointDetailsPattern"},"type":"array"},"rotationAngle":{"description":"This is the angle at which the unit is rotated in degrees with respect to the positive X axis.","type":"number"},"strokeIds":{"description":"This is an array of integers representing the list of stroke Identifiers from the input request body that belong to this recognition unit.","items":{"type":"integer"},"type":"array"}},"required":["category","parentId","strokeIds","class","id"],"type":"object"},"type":"array"},"shapePattern":{"description":"The category should be used to determines the field to read the recognition result. Recognized Object represents the shape that was recognized for the node with category as inkDrawing. For handwriting related nodes, recognizedText contains the actual recognition result.","enum":["drawing","square","rectangle","circle","ellipse","triangle","isoscelesTriangle","equilateralTriangle","rightTriangle","quadrilateral","diamond","trapezoid","parallelogram","pentagon","hexagon","blockArrow","heart","starSimple","starCrossed","cloud","line","curve","polyLine"],"type":"string","x-ms-enum":{"modelAsString":true,"name":"shape"}},"stroke":{"properties":{"drawingAttributes":{"$ref":"#/components/schemas/drawingAttributesPattern"},"id":{"description":"This is treated as a unique identifier for each stroke within a request. If the id is repeated within the same request, the service will return an error.","type":"integer"},"kind":{"description":"This is an optional property which influences the decision about what the stroke kind is between inkWriting and inkDrawing. This property should be set ONLY if the type of user content is known ahead of time. Not setting this value implies the kind is not known ahead of time. Kind represents the type of content the stroke is a part of.","enum":["inkDrawing","inkWriting"],"type":"string","x-ms-enum":{"modelAsString":true,"name":"kind"}},"language":{"description":"The IETF BCP 47 language code (for ex. en-US, en-GB, hi-IN etc.) of the expected language for the handwritten content in this stroke. The response will include results from this language.","type":"string"},"points":{"items":{"$ref":"#/components/schemas/inkPoint"},"type":"array"}},"required":["points","id"],"type":"object"}}}}