Skip to content

Commit

Permalink
[formrecognizer] some edits for code gen (#8814)
Browse files Browse the repository at this point in the history
* edits for code gen

* fix doc

* fix enums

* remove default enum value

* change valueDate to format: date

* fix examples

* update valueTime with type time

* remove type time for valueTime for now
  • Loading branch information
kristapratico authored Apr 7, 2020
1 parent ef3a1ab commit e85973b
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"name": "trainRequest",
Expand Down Expand Up @@ -74,52 +77,6 @@
"$ref": "./examples/TrainBatchWithSubFolders.json"
}
}
},
"get": {
"summary": "List Custom Models",
"description": "Get information about all custom models",
"operationId": "GetCustomModels",
"consumes": [],
"produces": [
"application/json"
],
"parameters": [
{
"name": "op",
"in": "query",
"description": "Specify whether to return summary or full list of models.",
"required": false,
"default": "full",
"type": "string",
"enum": [
"full",
"summary"
]
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/Models"
}
},
"default": {
"description": "Response entity accompanying non-successful responses containing additional details about the error.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink",
"itemName": "modelList"
},
"x-ms-examples": {
"List custom models": {
"$ref": "./examples/GetModels.json"
}
}
}
},
"/custom/models/{modelId}": {
Expand Down Expand Up @@ -218,6 +175,9 @@
"image/png",
"image/tiff"
],
"produces": [
"application/json"
],
"parameters": [
{
"name": "modelId",
Expand Down Expand Up @@ -493,6 +453,96 @@
}
}
},
"x-ms-paths": {
"/custom/models?op=full": {
"get": {
"summary": "List Custom Models",
"description": "Get information about all custom models",
"operationId": "ListCustomModels",
"consumes": [],
"produces": [
"application/json"
],
"parameters": [
{
"name": "op",
"in": "query",
"description": "Specify whether to return summary or full list of models.",
"required": true,
"type": "string",
"enum": [
"full"
]
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/Models"
}
},
"default": {
"description": "Response entity accompanying non-successful responses containing additional details about the error.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink",
"itemName": "modelList"
},
"x-ms-examples": {
"List custom models": {
"$ref": "./examples/GetModels.json"
}
}
}
},
"/custom/models?op=summary": {
"get": {
"summary": "Get Custom Models",
"description": "Get information about all custom models",
"operationId": "GetCustomModels",
"consumes": [],
"produces": [
"application/json"
],
"parameters": [
{
"name": "op",
"in": "query",
"description": "Specify whether to return summary or full list of models.",
"required": true,
"type": "string",
"enum": [
"summary"
]
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/Models"
}
},
"default": {
"description": "Response entity accompanying non-successful responses containing additional details about the error.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"x-ms-examples": {
"Get models summary": {
"$ref": "./examples/GetModelsSummary.json"
}
}
}
}
},
"definitions": {
"OperationStatus": {
"type": "string",
Expand Down Expand Up @@ -629,10 +679,6 @@
}
}
},
"SourceDataStream": {
"description": "A PDF document, image (jpg/png/tiff), or JSON file to analyze.",
"type": "object"
},
"ModelInfo": {
"description": "Basic custom model information.",
"type": "object",
Expand Down Expand Up @@ -696,7 +742,7 @@
"x-nullable": false
},
"limit": {
"description": "Max number of models that can be trained for this subscription.",
"description": "Max number of models that can be trained for this account.",
"type": "integer",
"x-nullable": false
},
Expand Down Expand Up @@ -1221,6 +1267,7 @@
},
"DocumentResult": {
"description": "A set of extracted fields corresponding to the input document.",
"type": "object",
"required": [
"docType",
"pageRange",
Expand Down Expand Up @@ -1268,14 +1315,13 @@
},
"valueDate": {
"description": "Date value.",
"format": "date",
"type": "string",
"format": "date-time",
"x-nullable": false
},
"valueTime": {
"description": "Time value.",
"type": "string",
"format": "date-time",
"x-nullable": false
},
"valuePhoneNumber": {
Expand Down Expand Up @@ -1376,7 +1422,7 @@
"x-ms-parameter-location": "method",
"in": "body",
"schema": {
"$ref": "#/definitions/SourceDataStream"
"$ref": "#/definitions/SourcePath"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
"responses": {
"200": {
"body": {
"summary": {
"count": 5,
"limit": 5000,
"lastUpdatedDateTime": "2019-05-01T10:53:21Z"
},
"modelList": [
{
"modelId": "f973e3c1-1148-43bb-bea8-49d0603ab3a8",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"parameters": {
"endpoint": "{endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"op": "summary",
"body": {}
},
"responses": {
"200": {
"body": {
"summary": {
"count": 5,
"limit": 5000,
"lastUpdatedDateTime": "2019-05-01T10:53:21Z"
}
}
}
}
}

0 comments on commit e85973b

Please sign in to comment.