diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/FormRecognizer.json new file mode 100644 index 000000000000..db9431589bd8 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/FormRecognizer.json @@ -0,0 +1,632 @@ +{ + "swagger": "2.0", + "info": { + "version": "v1.0-preview", + "title": "Cognitive Service Form Recognizer API V1 (Preview)", + "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", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "#/parameters/Endpoint" + } + ] + }, + "schemes": [ + "https" + ], + "paths": { + "/custom/train": { + "post": { + "summary": "Train Model", + "description": "The train request must include a source parameter that is either an externally accessible Azure Storage blob container Uri (preferably a Shared Access Signature Uri) or valid path to a data folder in a locally mounted drive. When local paths are specified, they must follow the Linux/Unix path format and be an absolute path rooted to the input mount configuration\r\n setting value e.g., if '{Mounts:Input}' configuration setting value is '/input' then a valid source path would be '/input/contosodataset'. All data to be trained are expected to be under the source. Models are trained using documents that are of the following content type - 'application/pdf', 'image/jpeg' and 'image/png'.\"\r\n Other content is ignored when training a model.", + "operationId": "TrainCustomModel", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "trainRequest", + "in": "body", + "description": "Request object for training.", + "required": true, + "schema": { + "$ref": "#/definitions/TrainRequest" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/TrainResult" + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Train new model example": { + "$ref": "./examples/Train.json" + } + } + } + }, + "/custom/models/{id}/keys": { + "get": { + "summary": "Get Keys", + "description": "Use the API to retrieve the keys that were\r\n extracted by the specified model.", + "operationId": "GetExtractedKeys", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Model identifier.", + "required": true, + "type": "string", + "format": "uuid" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/KeysResult" + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get Keys from Model": { + "$ref": "./examples/GetKeys.json" + } + } + } + }, + "/custom/models": { + "get": { + "summary": "Get Models", + "description": "Get information about all trained models", + "operationId": "GetCustomModels", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ModelsResult" + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get Model from id": { + "$ref": "./examples/GetModels.json" + } + } + } + }, + "/custom/models/{id}": { + "get": { + "summary": "Get Model", + "description": "Get information about a model.", + "operationId": "GetCustomModel", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Model identifier.", + "required": true, + "type": "string", + "format": "uuid" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ModelResult" + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get Model from id": { + "$ref": "./examples/GetModel.json" + } + } + }, + "delete": { + "summary": "Delete Model", + "description": "Delete model artifacts.", + "operationId": "DeleteCustomModel", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the model to delete.", + "required": true, + "type": "string", + "format": "uuid" + } + ], + "responses": { + "204": { + "description": "Successfully removed model artifacts." + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get Model from id": { + "$ref": "./examples/DeleteModel.json" + } + } + } + }, + "/custom/models/{id}/analyze": { + "post": { + "summary": "Analyze Form", + "description": "The document to analyze must be of a supported content type - 'application/pdf', 'image/jpeg' or 'image/png'. The response contains not just the extracted information of the analyzed form but also information about content that was not extracted along with a reason.", + "operationId": "AnalyzeWithCustomModel", + "consumes": [ + "application/pdf", + "image/jpeg", + "image/png", + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Model Identifier to analyze the document with.", + "required": true, + "type": "string", + "format": "uuid" + }, + { + "name": "keys", + "in": "query", + "description": "An optional list of known keys to extract the values for.", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": false + }, + { + "name": "form_stream", + "in": "formData", + "description": "A pdf document or image (jpg,png) file to analyze.", + "required": true, + "type": "file" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/AnalyzeResult" + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get Model from id": { + "$ref": "./examples/Analyze.json" + } + } + } + } + }, + "definitions": { + "TrainRequest": { + "description": "Contract to initiate a train request.", + "required": [ + "source" + ], + "type": "object", + "properties": { + "source": { + "description": "Get or set source path.", + "maxLength": 2048, + "minLength": 0, + "type": "string" + } + } + }, + "TrainResult": { + "description": "Response of the Train API call.", + "type": "object", + "properties": { + "modelId": { + "description": "Identifier of the model.", + "type": "string", + "format": "uuid", + "x-nullable": false + }, + "trainingDocuments": { + "description": "List of documents used to train the model and the\r\ntrain operation error reported by each.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/FormDocumentReport" + } + }, + "errors": { + "description": "Errors returned during the training operation.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/FormOperationError" + } + } + } + }, + "KeysResult": { + "description": "Result of an operation to get\r\nthe keys extracted by a model.", + "type": "object", + "properties": { + "clusters": { + "description": "Object mapping ClusterIds to Key lists.", + "type": "object", + "additionalProperties": { + "uniqueItems": false, + "type": "array", + "items": { "type": "string" } + } + } + } + }, + "ModelResult": { + "description": "Result of a model status query operation.", + "type": "object", + "properties": { + "modelId": { + "description": "Get or set model identifier.", + "type": "string", + "format": "uuid", + "x-nullable": false + }, + "status": { + "description": "Get or set the status of model.", + "enum": [ "created", "ready", "invalid" ], + "type": "string" + }, + "createdDateTime": { + "format": "date-time", + "description": "Get or set the created date time of the model.", + "type": "string" + }, + "lastUpdatedDateTime": { + "format": "date-time", + "description": "Get or set the model last updated datetime.", + "type": "string" + } + } + }, + "ModelsResult": { + "description": "Result of query operation to fetch multiple models.", + "type": "object", + "properties": { + "models": { + "description": "Collection of models.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/ModelResult" + } + } + } + }, + "FormDocumentReport": { + "type": "object", + "properties": { + "documentName": { + "description": "Reference to the data that the report is for.", + "type": "string" + }, + "pages": { + "format": "int32", + "description": "Total number of pages trained on.", + "type": "integer" + }, + "errors": { + "description": "List of errors per page.", + "uniqueItems": false, + "type": "array", + "items": { + "type": "string" + } + }, + "status": { + "description": "Status of the training operation.", + "enum": [ + "success", + "partialSuccess", + "failure" + ], + "type": "string" + } + } + }, + "FormOperationError": { + "description": "Error reported during an operation.", + "type": "object", + "properties": { + "errorMessage": { + "description": "Message reported during the train operation.", + "type": "string" + } + } + }, + "ErrorResponse": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/ErrorInformation" + } + } + }, + "ErrorInformation": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "innerError": { + "$ref": "#/definitions/InnerError" + }, + "message": { + "type": "string" + } + } + }, + "InnerError": { + "type": "object", + "properties": { + "requestId": { + "type": "string" + } + } + }, + "AnalyzeResult": { + "description": "Analyze API call result.", + "type": "object", + "properties": { + "status": { + "description": "Status of the analyze operation.", + "enum": [ + "success", + "partialSuccess", + "failure" + ], + "type": "string" + }, + "pages": { + "description": "Page level information extracted in the analyzed\r\ndocument.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/ExtractedPage" + } + }, + "errors": { + "description": "List of errors reported during the analyze\r\noperation.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/FormOperationError" + } + } + } + }, + "ExtractedPage": { + "description": "Extraction information of a single page in a\r\nwith a document.", + "type": "object", + "properties": { + "number": { + "format": "int32", + "description": "Page number.", + "type": "integer" + }, + "height": { + "format": "int32", + "description": "Height of the page (in pixels).", + "type": "integer" + }, + "width": { + "format": "int32", + "description": "Width of the page (in pixels).", + "type": "integer" + }, + "clusterId": { + "format": "int32", + "description": "Cluster identifier.", + "type": "integer" + }, + "keyValuePairs": { + "description": "List of Key-Value pairs extracted from the page.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/ExtractedKeyValuePair" + } + }, + "tables": { + "description": "List of Tables and their information extracted from the page.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/ExtractedTable" + } + } + } + }, + "ExtractedKeyValuePair": { + "description": "Representation of a key-value pair as a list\r\nof key and value tokens.", + "type": "object", + "properties": { + "key": { + "description": "List of tokens for the extracted key in a key-value pair.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/ExtractedToken" + } + }, + "value": { + "description": "List of tokens for the extracted value in a key-value pair.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/ExtractedToken" + } + } + } + }, + "ExtractedTable": { + "description": "Extraction information about a table\r\ncontained in a page.", + "type": "object", + "properties": { + "id": { + "description": "Table identifier.", + "type": "string" + }, + "columns": { + "description": "List of columns contained in the table.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/ExtractedTableColumn" + } + } + } + }, + "ExtractedToken": { + "description": "Canonical representation of single extracted text.", + "type": "object", + "properties": { + "text": { + "description": "String value of the extracted text.", + "type": "string" + }, + "boundingBox": { + "description": "Bounding box of the extracted text. Represents the\r\nlocation of the extracted text as a pair of\r\ncartesian co-ordinates. The co-ordinate pairs are arranged by\r\ntop-left, top-right, bottom-right and bottom-left endpoints box\r\nwith origin reference from the bottom-left of the page.", + "uniqueItems": false, + "type": "array", + "items": { + "format": "double", + "type": "number" + } + }, + "confidence": { + "format": "double", + "description": "A measure of accuracy of the extracted text.", + "type": "number" + } + } + }, + "ExtractedTableColumn": { + "description": "Extraction information of a column in\r\na table.", + "type": "object", + "properties": { + "header": { + "description": "List of extracted tokens for the column header.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/ExtractedToken" + } + }, + "entries": { + "description": "Extracted text for each cell of a column. Each cell\r\nin the column can have a list of one or more tokens.", + "uniqueItems": false, + "type": "array", + "items": { + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/ExtractedToken" + } + } + } + } + } + }, + "parameters": { + "Endpoint": { + "name": "Endpoint", + "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).", + "x-ms-parameter-location": "client", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/Analyze.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/Analyze.json new file mode 100644 index 000000000000..e7d6b8978479 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/Analyze.json @@ -0,0 +1,110 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "id": "{Model Id}", + "body": { + "formData": { + } + }, + "form_stream": "{Image or Pdf file stream}" + }, + "responses": { + "200": { + "body":{ + "status": "success", + "pages": [ + { + "number": 1, + "height": 800, + "width": 600, + "clusterId": 0, + "keyValuePairs": [ + { + "key": [ + { + "text": "Address:", + "boundingBox": [ + 57.4, + 683.1, + 100.5, + 683.1, + 100.5, + 673.7, + 57.4, + 673.7 + ] + } + ], + "value": [ + { + "text": "1 Microsoft Way", + "boundingBox": [ + 57.4, + 672.2, + 126.6, + 672.2, + 126.6, + 658.9, + 57.4, + 658.9 + ], + "confidence": 0.9 + } + ] + } + ], + "tables": [ + { + "id": "table_0", + "columns": [ + { + "header": [ + { + "text": "InvoiceNumber", + "boundingBox": [ + 38.5, + 585.2, + 113.4, + 585.2, + 113.4, + 575.8, + 38.5, + 575.8 + ] + } + ], + "entries": [ + [ + { + "text": "38772349", + "boundingBox": [ + 305.6, + 692.1, + 403.5, + 692.1, + 403.5, + 684.2, + 305.6, + 684.2 + ], + "confidence": 0.9 + } + ] + ] + } + ] + } + ] + } + ], + "errors": [ + { + "errorMessage": "Page1: Field not extracted" + } + ] + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/DeleteModel.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/DeleteModel.json new file mode 100644 index 000000000000..f157f9ac038b --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/DeleteModel.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "id": "{Model Id}", + "body": { + } + }, + "responses": { + "204": { + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/GetKeys.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/GetKeys.json new file mode 100644 index 000000000000..174194c2ecd7 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/GetKeys.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "id": "{Model Id}", + "body": { + } + }, + "responses": { + "200": { + "body": { + "clusters": { + "0": [ + "Invoice", + "123112313" + ], + "1": [ + "Please remit payment to:", + "Microsoft" + ] + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/GetModel.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/GetModel.json new file mode 100644 index 000000000000..1e8abf15a011 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/GetModel.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "id": "{Model Id}", + "body": { + } + }, + "responses": { + "200": { + "body": { + "modelId": "f973e3c1-1148-43bb-bea8-49d0603ab3a8", + "status": "ready", + "createdDateTime": "2019-05-01T10:53:21+00:00", + "lastUpdatedDateTime": "2019-05-01T10:53:23+00:00" + } + } + } +} \ No newline at end of file diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/GetModels.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/GetModels.json new file mode 100644 index 000000000000..908a1cc4ca84 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/GetModels.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "id": "{Model Id}", + "body": { + } + }, + "responses": { + "200": { + "body": { + "models": [ + { + "modelId": "f973e3c1-1148-43bb-bea8-49d0603ab3a8", + "status": "ready", + "createdDateTime": "2019-05-01T10:53:21+00:00", + "lastUpdatedDateTime": "2019-05-01T10:53:23+00:00" + }, + { + "modelId": "8dd53a98-bc73-43da-8533-60183824eb8e", + "status": "ready", + "createdDateTime": "2019-04-30T21:39:41+00:00", + "lastUpdatedDateTime": "2019-04-30T21:39:44+00:00" + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/Train.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/Train.json new file mode 100644 index 000000000000..0bbd8c65df62 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/examples/Train.json @@ -0,0 +1,52 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": { + }, + "trainRequest" : { + "source": "/input/data" + } + }, + "responses": { + "200": { + "body":{ + "modelId": "ad1901b6-ddaa-4249-8938-3f03f65cc893", + "trainingDocuments": [ + { + "documentName": "0.pdf", + "pages": 1, + "errors": [], + "status": "success" + }, + { + "documentName": "1.pdf", + "pages": 1, + "errors": [], + "status": "success" + }, + { + "documentName": "2.pdf", + "pages": 1, + "errors": [], + "status": "success" + }, + { + "documentName": "3.pdf", + "pages": 1, + "errors": [], + "status": "success" + }, + { + "documentName": "4.pdf", + "pages": 1, + "errors": [], + "status": "success" + } + ], + "errors": [] + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/feedback.md b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/feedback.md new file mode 100644 index 000000000000..e34d3e792b1a --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v1.0/feedback.md @@ -0,0 +1,47 @@ +Form Recognizer: API Review Feedback + +PR Link: https://github.com/Azure/azure-rest-api-specs/pull/5684 + +Feedback: +--------- +1. [shahabhijeet] Don't specify x-nullable: false. +2. [shahabhijeet] Use x-ms-enum for Status field (or other enums) +3. [shahabhijeet] Consider modeling error responses to something like: +{ + "error": { + "code": "", + "message": "", + "target": "", + "additionalInfo": [], + "details": [ + { + "code": "", + "target": "", + "message": "", + "additionalInfo": [ + { + "type": "PolicyViolation", + "info": { + "policySetDefinitionDisplayName": "Secure the environment", + "policySetDefinitionId":"/subscriptions/00000-00000-0000-000/providers/Microsoft.Authorization/policySetDefinitions/TestPolicySet", + "policyDefinitionDisplayName": "Allowed locations", + "policyDefinitionId":"/subscriptions/00000-00000-0000-000/providers/Microsoft.Authorization/policyDefinitions/TestPolicy1", + "policyAssignmentDisplayName": "Allow Central US and WEU only", + "policyAsssignmentId":"/subscriptions/00000-00000-0000-000/providers/Microsoft.Authorization/policyAssignments/TestAssignment1", + ... + ... + ... + } + } + ] + } + ] + } +} +Also: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-details.md#error-response-content +(this is not the updated link, as I am trying to find the updated model, will post as soon as I find it, hence provided an actual example. +The format I am recommending allows you to have multiple error information objects as an array and "info" object is nothing but a generic JObject for dumping information like innerException. + +4. [johanste] /TrainCustomModel operation creates an addressable resource (keyed by the modelId in the response) +This should probably return a 201 with a Location header pointing to the result. + diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/readme.go.md b/specification/cognitiveservices/data-plane/FormRecognizer/readme.go.md new file mode 100644 index 000000000000..f27d16b9f5f3 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/readme.go.md @@ -0,0 +1,26 @@ +## Go + +These settings apply only when `--go` is specified on the command line. + +``` yaml $(go) +go: + license-header: MICROSOFT_APACHE_NO_VERSION + namespace: formrecognizer + clear-output-folder: true +``` + +### Go multi-api + +``` yaml $(go) && $(multiapi) +batch: + - tag: release_1_0 +``` + +### Tag: release_1_0 and go + +These settings apply only when `--tag=release_1_0 --go` is specified on the command line. +Please also specify `--go-sdk-folder=`. + +``` yaml $(tag) == 'release_1_0' && $(go) +output-folder: $(go-sdk-folder)/services/cognitiveservices/v1.0/$(namespace) +``` \ No newline at end of file diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/readme.md b/specification/cognitiveservices/data-plane/FormRecognizer/readme.md new file mode 100644 index 000000000000..2b2e234f7b27 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/readme.md @@ -0,0 +1,71 @@ +# Cognitive Services Form Recognizer SDK + +> see https://aka.ms/autorest + +Configuration for generating Form Recognizer SDK. + +The current release is `release_1_0`. + +``` yaml + +tag: release_1_0 +add-credentials: true +openapi-type: data-plane +``` +# Releases + +### Release 1.0 +These settings apply only when `--tag=release_1_0` is specified on the command line. + +``` yaml $(tag) == 'release_1_0' +input-file: preview/v1.0/FormRecognizer.json +``` + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +``` yaml $(swagger-to-sdk) +swagger-to-sdk: + - repo: azure-sdk-for-python + - repo: azure-sdk-for-java + - repo: azure-sdk-for-go + - repo: azure-sdk-for-node + - repo: azure-sdk-for-ruby + after_scripts: + - bundle install && rake arm:regen_all_profiles['azure_cognitiveservices_formrecognizer'] +``` + + +## CSharp Settings +These settings apply only when `--csharp` is specified on the command line. +``` yaml $(csharp) +csharp: + sync-methods: None + license-header: MICROSOFT_MIT_NO_VERSION + azure-arm: false + namespace: Microsoft.Azure.CognitiveServices.FormRecognizer + output-folder: $(csharp-sdks-folder)/CognitiveServices/dataPlane/Vision/FormRecognizer/Generated + clear-output-folder: true +``` + +## Go + +See configuration in [readme.go.md](./readme.go.md) + +## Java + +These settings apply only when `--java` is specified on the command line. +Please also specify `--azure-libraries-for-java-folder=`. + +``` yaml $(java) +java: + azure-arm: true + namespace: com.microsoft.azure.cognitiveservices.formrecognizer + license-header: MICROSOFT_MIT_NO_CODEGEN + payload-flattening-threshold: 1 + output-folder: $(azure-libraries-for-java-folder)/cognitiveservices/data-plane/vision/formrecognizer + with-optional-parameters: true + with-single-async-method: true +``` diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/readme.nodejs.md b/specification/cognitiveservices/data-plane/FormRecognizer/readme.nodejs.md new file mode 100644 index 000000000000..dfd76a33e82f --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/readme.nodejs.md @@ -0,0 +1,14 @@ +## Node.js + +These settings apply only when `--nodejs` is specified on the command line. +Please also specify `--node-sdks-folder=`. + +``` yaml $(nodejs) +nodejs: + package-name: azure-cognitiveservices-formrecognizer + output-folder: $(node-sdks-folder)/lib/services/cognitiveServicesFormRecognizer + azure-arm: false + generate-license-txt: true + generate-package-json: true + generate-readme-md: true +``` diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/readme.python.md b/specification/cognitiveservices/data-plane/FormRecognizer/readme.python.md new file mode 100644 index 000000000000..48fb784d3340 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/readme.python.md @@ -0,0 +1,26 @@ +## Python + +These settings apply only when `--python` is specified on the command line. +Please also specify `--python-sdks-folder=`. +Use `--python-mode=update` if you already have a setup.py and just want to update the code itself. + +``` yaml $(python) +python-mode: create +python: + license-header: MICROSOFT_MIT_NO_VERSION + add-credentials: true + payload-flattening-threshold: 2 + namespace: azure.cognitiveservices.formrecognizer + package-name: azure-cognitiveservices-formrecognizer + clear-output-folder: true +``` +``` yaml $(python) && $(python-mode) == 'update' +python: + no-namespace-folders: true + output-folder: $(python-sdks-folder)/azure-cognitiveservices-formrecognizer/azure/cognitiveservices/formrecognizer +``` +``` yaml $(python) && $(python-mode) == 'create' +python: + basic-setup-py: true + output-folder: $(python-sdks-folder)/azure-cognitiveservices-formrecognizer +``` diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/readme.ruby.md b/specification/cognitiveservices/data-plane/FormRecognizer/readme.ruby.md new file mode 100644 index 000000000000..b1212ecca1ab --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/readme.ruby.md @@ -0,0 +1,27 @@ +## Ruby + +These settings apply only when `--ruby` is specified on the command line. + +``` yaml +package-name: azure_cognitiveservices_formrecognizer +package-version: "0.16.0" +azure-arm: true +``` + +### Ruby multi-api + +``` yaml $(ruby) && $(multiapi) +batch: + - tag: release_1_0 +``` + +### Tag: release_1_0 and ruby + +These settings apply only when `--tag=release_1_0 --ruby` is specified on the command line. +Please also specify `--ruby-sdks-folder=`. + +``` yaml $(tag) == 'release_1_0' && $(ruby) +namespace: "Azure::CognitiveServices::FormReognizer::V1_0" +output-folder: $(ruby-sdks-folder)/data/azure_cognitiveservices_formrecognizer/lib +title: "FormClient" +``` diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/readme.typescript.md b/specification/cognitiveservices/data-plane/FormRecognizer/readme.typescript.md new file mode 100644 index 000000000000..eb00a054ac7c --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/readme.typescript.md @@ -0,0 +1,12 @@ +## TypeScript + +These settings apply only when `--typescript` is specified on the command line. +Please also specify `--typescript-sdks-folder=`. + +``` yaml $(typescript) +typescript: + package-name: "@azure/cognitiveservices-formrecognizer" + output-folder: "$(typescript-sdks-folder)/sdk/cognitiveservices/cognitiveservices-formrecognizer" + azure-arm: false + generate-metadata: true +```