Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
c30a385
Initial commit.
Apr 17, 2019
00e4cf3
Incorporating PR feedback
Apr 18, 2019
8dbcee7
Adding examples, cleanup.
Apr 18, 2019
90946c6
Fixing json syntax errors.
Apr 18, 2019
5812674
Incorporating feedback.
Apr 18, 2019
843f2f7
Refactor swagger to common type.
Apr 18, 2019
2c78f40
Incorporating feedback.
Apr 19, 2019
3840cae
Moved to preview, refactor, fixes.
Apr 19, 2019
29ea35b
Updated text.
Apr 19, 2019
6efacb5
Minor text change.
Apr 19, 2019
292f8ba
More minor text updates.
Apr 19, 2019
781f7db
Reverting accidental change
Apr 21, 2019
10c7f52
Refactor
Apr 21, 2019
e137884
Refactor, Adding GetModels REST API placeholder
Apr 22, 2019
3753fc5
Refactor, fixes
Apr 25, 2019
5ed88d4
Refactor, Updated definitions.
Apr 25, 2019
9864cca
Fix type definition
Apr 25, 2019
da9d7d3
model* API endpoint updated
Apr 26, 2019
81b6743
Fix build issue, Reverting change to face swagger
Apr 26, 2019
4d75131
updated namespace
Apr 26, 2019
29e2bc7
Updated return type for /models api
Apr 27, 2019
4e65e77
Update FormRecognizer.json
Bastortz2 Apr 27, 2019
3ae0d35
Merge pull request #1 from Bastortz2/patch-2
ramparab Apr 27, 2019
4c99141
Refactor, opid changes.
Apr 30, 2019
8385975
removing multi as it causing autorest codegen issues with langs like …
Apr 30, 2019
9b1f37a
reverting face.json changes.
Apr 30, 2019
355ce60
renamed example, fixed typo in example to make it valid json
Apr 30, 2019
afc041b
API review feedback, Reverting OpIds
Apr 30, 2019
c5ddd4b
API review feedback, fixing examples for model verification
May 1, 2019
0f9441c
Fixing examples for model validation
May 1, 2019
6b2d1b2
Capturing feedback from API Review
May 1, 2019
0c0e7b2
Capturing feedback from API review
May 1, 2019
96cb967
Fix generated code path, Fix generated SDK class name
May 2, 2019
9e59952
merging from master
May 2, 2019
a85c578
Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs
May 2, 2019
af8009b
Update title to be used for SDK code generation
May 3, 2019
fb11a90
Updating help text.
May 14, 2019
4748bc0
resolving conflict
May 14, 2019
e588f2f
Update help text.
May 14, 2019
8b27a4e
Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs
May 14, 2019
e8cce48
Update help text.
May 14, 2019
c73dbf1
Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs
May 21, 2019
808aa67
Initial commit.
May 21, 2019
011ff10
Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs
May 22, 2019
2da631e
merging receipts with FR
May 22, 2019
68cd858
update for receipt
May 22, 2019
f7634c2
Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs
May 22, 2019
4a2ffc9
Receipt merge update
May 22, 2019
a41344c
Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs
May 24, 2019
9fc0310
add receipt ref, update ocr json
May 24, 2019
0070fb5
fix readme
May 24, 2019
967a5e8
Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs
May 27, 2019
d526807
Fix Receipt swagger title field
May 27, 2019
abdd49f
Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs
May 28, 2019
5f88348
Fixing receipt API verification issues.
May 28, 2019
9b2e05f
Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs
May 30, 2019
a5efc53
fixing build issues
May 30, 2019
9c2b0e4
Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs
May 30, 2019
b93b646
removing empty lines.
May 30, 2019
e83304c
adding description for understandingResult
May 30, 2019
abd110f
Adding reference to Ocr swagger.
May 30, 2019
f346e31
Trimming OCR to remove unreferenced definitions.
May 30, 2019
bf2cd12
Adding missing definitions.
May 30, 2019
e6f6927
Fixing build issues.
May 30, 2019
67e3772
Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs
May 30, 2019
ef8d9f6
Adding updated OCR reference.
May 30, 2019
1dca244
fix version
May 30, 2019
f2a1c72
fixing typo
May 30, 2019
6b22120
capturing feedback from API PR review.
May 30, 2019
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
@@ -0,0 +1,258 @@
{
"swagger": "2.0",
"info": {
"version": "1.0-preview",
"title": "Form Recognizer Client",
"description": "Extracts information from forms and images into structured data based on a model created by a set of representative training forms."
},
"securityDefinitions": {
"apim_key": {
"type": "apiKey",
"name": "Ocp-Apim-Subscription-Key",
"in": "header"
}
},
"security": [
{
"apim_key": []
}
],
"x-ms-parameterized-host": {
"hostTemplate": "{Endpoint}/formrecognizer/v1.0-preview",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are URLs dependent on api version

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, this is the convention for Cognitive Services.

"useSchemePrefix": false,
"parameters": [
{
"$ref": "FormRecognizerReceiptOcr.json#/parameters/Endpoint"
}
]
},
"schemes": [
"https"
],
"paths": {
"/prebuilt/receipt/asyncBatchAnalyze": {
"post": {
"description": "Batch Read Receipt operation. The response contains a field called 'Operation-Location', which contains the URL that you must use for your 'Get Read Receipt Result' operation.",
"operationId": "BatchReadReceipt",
"parameters": [
{
"$ref": "FormRecognizerReceiptOcr.json#/parameters/ImageUrl"
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"202": {
"description": "The service has accepted the request and will start processing later. It will return 'Accepted' immediately and include an 'Operation-Location' header. Client side should further query the operation status using the URL specified in this header. The 'Operation-Location' URL will expire in 48 hours.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks like a long running operation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It is. Due to consistency with existing Cognitive Service APIs, we are not able to adopt the latest conventions. The API review board has agreed with this design.

"headers": {
"Operation-Location": {
"description": "URL to query for status of the operation. The URL will expire in 48 hours. ",
"type": "string"
}
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "FormRecognizerReceiptOcr.json#/definitions/ComputerVisionError"
}
}
},
"x-ms-examples": {
"Successful 'Batch Read Receipt' request": {
"$ref": "./examples/SuccessfulBatchReadReceiptWithUrl.json"
}
}
}
},
"/prebuilt/receipt/operations/{operationId}": {
"get": {
"description": "This interface is used for getting the analysis results of a 'Batch Read Receipt' operation. The URL to this interface should be retrieved from the 'Operation-Location' field returned from the 'Batch Read Receipt' operation.",
"operationId": "GetReadReceiptResult",
"parameters": [
{
"name": "operationId",
"in": "path",
"description": "Id of read operation returned in the response of a 'Batch Read Receipt' operation.",
"required": true,
"type": "string"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Returns the read operation status.",
"schema": {
"$ref": "#/definitions/readReceiptResult"
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "FormRecognizerReceiptOcr.json#/definitions/ComputerVisionError"
}
}
},
"x-ms-examples": {
"Successful 'Get Read Receipt Result' request": {
"$ref": "./examples/SuccessfulReadReceiptResult.json"
}
}
}
}
},
"x-ms-paths": {
"/prebuilt/receipt/asyncBatchAnalyze?overload=stream": {
"post": {
"description": "Read Receipt operation. When you use the 'Batch Read Receipt' interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your 'Get Read Receipt Result' operation.",
"operationId": "BatchReadReceiptInStream",
"parameters": [
{
"$ref": "FormRecognizerReceiptOcr.json#/parameters/ImageStream"
}
],
"consumes": [
"application/octet-stream"
],
"produces": [
"application/json"
],
"responses": {
"202": {
"description": "The service has accepted the request and will start processing later. It will return 'Accepted' immediately and include an 'Operation-Location' header. Client side should further query the operation status using the URL specified in this header. The 'Operation-Location' URL will expire in 48 hours.",
"headers": {
"Operation-Location": {
"description": "URL to query for status of the operation. The URL will expire in 48 hours. ",
"type": "string"
}
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "FormRecognizerReceiptOcr.json#/definitions/ComputerVisionError"
}
}
},
"x-ms-examples": {
"Successful 'Batch Read Receipt' request": {
"$ref": "./examples/SuccessfulBatchReadReceiptWithStream.json"
}
}
}
}
},
"definitions": {
"readReceiptResult": {
"type": "object",
"description": "Analysis result of the 'Batch Read Receipt' operation.",
"properties": {
"status": {
"description": "Status of the read operation.",
"$ref": "FormRecognizerReceiptOcr.json#/definitions/OperationStatus"
},
"recognitionResults": {
"description": "Text recognition result of the 'Batch Read Receipt' operation.",
"type": "array",
"items": {
"$ref": "FormRecognizerReceiptOcr.json#/definitions/TextRecognitionResult"
}
},
"understandingResults": {
"description": "Semantic understanding result of the 'Batch Read Receipt' operation.",
"type": "array",
"items": {
"$ref": "#/definitions/understandingResult"
}
}
}
},
"understandingResult": {
"description" : "A set of extracted fields corresponding to a semantic object, such as a receipt, in the input document.",
"properties": {
"pages": {
"description": "List of pages where the document is found.",
"type": "array",
"items": {
"type": "integer",
"x-nullable": false
}
},
"fields": {
"description": "Dictionary of recognized field values.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/fieldValue"
}
}
}
},
"elementReference": {
"description": "Reference to an OCR word.",
"properties": {
"$ref": {
"type": "string"
}
}
},
"fieldValue": {
"description": "Base class representing a recognized field value.",
"type": "object",
"discriminator": "valueType",
"required": [
"valueType"
],
"properties": {
"valueType": {
"description": "Discriminator for derived types.",
"type": "string"
},
"text": {
"description": "OCR text content of the recognized field.",
"type": "string"
},
"elements": {
"description": "List of references to OCR words comprising the recognized field value.",
"type": "array",
"items": {
"$ref": "#/definitions/elementReference"
}
}
}
},
"stringValue": {
"description": "Recognized string field value.",
"allOf": [
{
"$ref": "#/definitions/fieldValue"
}
],
"properties": {
"value": {
"description": "String value of the recognized field.",
"type": "string"
}
}
},
"numberValue": {
"description": "Recognized numeric field value.",
"allOf": [
{
"$ref": "#/definitions/fieldValue"
}
],
"properties": {
"value": {
"description": "Numeric value of the recognized field.",
"type": "number"
}
}
}
}
}
Loading