Skip to content

Commit b53cd31

Browse files
authored
[Language] Remove duplication for PreBuiltResult and InputError (#23788)
* Remove duplication for PreBuiltResult and InputError * Remove RequestStatistics in analyzetext.json * Remove additionalProperties * Add object type for PreBuiltResult
1 parent 8904226 commit b53cd31

File tree

4 files changed

+28
-174
lines changed

4 files changed

+28
-174
lines changed

dev/cognitiveservices/data-plane/Language/analyzetext.json

Lines changed: 10 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -545,29 +545,6 @@
545545
}
546546
]
547547
},
548-
"PreBuiltResult": {
549-
"type": "object",
550-
"properties": {
551-
"errors": {
552-
"type": "array",
553-
"description": "Errors by document id.",
554-
"items": {
555-
"$ref": "#/definitions/DocumentError"
556-
}
557-
},
558-
"statistics": {
559-
"$ref": "#/definitions/RequestStatistics"
560-
},
561-
"modelVersion": {
562-
"type": "string",
563-
"description": "This field indicates which model is used for scoring."
564-
}
565-
},
566-
"required": [
567-
"errors",
568-
"modelVersion"
569-
]
570-
},
571548
"CustomTaskParameters": {
572549
"type": "object",
573550
"description": "Parameters object for a text analysis task using custom models.",
@@ -598,11 +575,11 @@
598575
"type": "array",
599576
"description": "Errors by document id.",
600577
"items": {
601-
"$ref": "#/definitions/DocumentError"
578+
"$ref": "common.json#/definitions/DocumentError"
602579
}
603580
},
604581
"statistics": {
605-
"$ref": "#/definitions/RequestStatistics"
582+
"$ref": "common.json#/definitions/RequestStatistics"
606583
},
607584
"projectName": {
608585
"type": "string",
@@ -825,7 +802,7 @@
825802
},
826803
"allOf": [
827804
{
828-
"$ref": "#/definitions/PreBuiltResult"
805+
"$ref": "common.json#/definitions/PreBuiltResult"
829806
}
830807
],
831808
"required": [
@@ -1168,7 +1145,7 @@
11681145
},
11691146
"allOf": [
11701147
{
1171-
"$ref": "#/definitions/PreBuiltResult"
1148+
"$ref": "common.json#/definitions/PreBuiltResult"
11721149
}
11731150
],
11741151
"required": [
@@ -1505,7 +1482,7 @@
15051482
},
15061483
"allOf": [
15071484
{
1508-
"$ref": "#/definitions/PreBuiltResult"
1485+
"$ref": "common.json#/definitions/PreBuiltResult"
15091486
}
15101487
],
15111488
"required": [
@@ -1634,7 +1611,7 @@
16341611
},
16351612
"allOf": [
16361613
{
1637-
"$ref": "#/definitions/PreBuiltResult"
1614+
"$ref": "common.json#/definitions/PreBuiltResult"
16381615
}
16391616
],
16401617
"required": [
@@ -1803,7 +1780,7 @@
18031780
},
18041781
"allOf": [
18051782
{
1806-
"$ref": "#/definitions/PreBuiltResult"
1783+
"$ref": "common.json#/definitions/PreBuiltResult"
18071784
}
18081785
],
18091786
"required": [
@@ -2247,7 +2224,7 @@
22472224
},
22482225
"allOf": [
22492226
{
2250-
"$ref": "#/definitions/PreBuiltResult"
2227+
"$ref": "common.json#/definitions/PreBuiltResult"
22512228
}
22522229
],
22532230
"required": [
@@ -2313,7 +2290,7 @@
23132290
},
23142291
"allOf": [
23152292
{
2316-
"$ref": "#/definitions/PreBuiltResult"
2293+
"$ref": "common.json#/definitions/PreBuiltResult"
23172294
}
23182295
],
23192296
"required": [
@@ -2395,7 +2372,7 @@
23952372
"AnalyzeTextJobStatistics": {
23962373
"properties": {
23972374
"statistics": {
2398-
"$ref": "#/definitions/RequestStatistics"
2375+
"$ref": "common.json#/definitions/RequestStatistics"
23992376
}
24002377
},
24012378
"type": "object"
@@ -2692,24 +2669,6 @@
26922669
}
26932670
}
26942671
},
2695-
"DocumentError": {
2696-
"type": "object",
2697-
"required": [
2698-
"id",
2699-
"error"
2700-
],
2701-
"properties": {
2702-
"id": {
2703-
"type": "string",
2704-
"description": "Document Id."
2705-
},
2706-
"error": {
2707-
"type": "object",
2708-
"description": "Document Error.",
2709-
"$ref": "common.json#/definitions/Error"
2710-
}
2711-
}
2712-
},
27132672
"DocumentWarning": {
27142673
"type": "object",
27152674
"required": [
@@ -2759,38 +2718,6 @@
27592718
},
27602719
"description": "if showStats=true was specified in the request this field will contain information about the document payload."
27612720
},
2762-
"RequestStatistics": {
2763-
"type": "object",
2764-
"required": [
2765-
"documentsCount",
2766-
"validDocumentsCount",
2767-
"erroneousDocumentsCount",
2768-
"transactionsCount"
2769-
],
2770-
"properties": {
2771-
"documentsCount": {
2772-
"type": "integer",
2773-
"format": "int32",
2774-
"description": "Number of documents submitted in the request."
2775-
},
2776-
"validDocumentsCount": {
2777-
"type": "integer",
2778-
"format": "int32",
2779-
"description": "Number of valid documents. This excludes empty, over-size limit or non-supported languages documents."
2780-
},
2781-
"erroneousDocumentsCount": {
2782-
"type": "integer",
2783-
"format": "int32",
2784-
"description": "Number of invalid documents. This includes empty, over-size limit or non-supported languages documents."
2785-
},
2786-
"transactionsCount": {
2787-
"type": "integer",
2788-
"format": "int64",
2789-
"description": "Number of transactions for the request."
2790-
}
2791-
},
2792-
"description": "if showStats=true was specified in the request this field will contain information about the request payload."
2793-
},
27942721
"MultiLanguageInput": {
27952722
"type": "object",
27962723
"description": "Contains an input document to be analyzed by the service.",

dev/cognitiveservices/data-plane/Language/common.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@
301301
},
302302
"type": "object"
303303
},
304-
"InputError": {
304+
"DocumentError": {
305305
"type": "object",
306306
"description": "Contains details of errors encountered during a job execution.",
307307
"required": [
@@ -311,7 +311,7 @@
311311
"properties": {
312312
"id": {
313313
"type": "string",
314-
"description": "The ID of the input."
314+
"description": "The ID of the input document."
315315
},
316316
"error": {
317317
"type": "object",
@@ -372,16 +372,16 @@
372372
"description": "Number of transactions for the request."
373373
}
374374
},
375-
"additionalProperties": true,
376375
"description": "if showStats=true was specified in the request this field will contain information about the request payload."
377376
},
378377
"PreBuiltResult": {
378+
"type": "object",
379379
"properties": {
380380
"errors": {
381381
"type": "array",
382382
"description": "Errors by document id.",
383383
"items": {
384-
"$ref": "#/definitions/InputError"
384+
"$ref": "#/definitions/DocumentError"
385385
}
386386
},
387387
"statistics": {

specification/cognitiveservices/data-plane/Language/stable/2023-04-01/analyzetext.json

Lines changed: 10 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -545,29 +545,6 @@
545545
}
546546
]
547547
},
548-
"PreBuiltResult": {
549-
"type": "object",
550-
"properties": {
551-
"errors": {
552-
"type": "array",
553-
"description": "Errors by document id.",
554-
"items": {
555-
"$ref": "#/definitions/DocumentError"
556-
}
557-
},
558-
"statistics": {
559-
"$ref": "#/definitions/RequestStatistics"
560-
},
561-
"modelVersion": {
562-
"type": "string",
563-
"description": "This field indicates which model is used for scoring."
564-
}
565-
},
566-
"required": [
567-
"errors",
568-
"modelVersion"
569-
]
570-
},
571548
"CustomTaskParameters": {
572549
"type": "object",
573550
"description": "Parameters object for a text analysis task using custom models.",
@@ -598,11 +575,11 @@
598575
"type": "array",
599576
"description": "Errors by document id.",
600577
"items": {
601-
"$ref": "#/definitions/DocumentError"
578+
"$ref": "common.json#/definitions/DocumentError"
602579
}
603580
},
604581
"statistics": {
605-
"$ref": "#/definitions/RequestStatistics"
582+
"$ref": "common.json#/definitions/RequestStatistics"
606583
},
607584
"projectName": {
608585
"type": "string",
@@ -825,7 +802,7 @@
825802
},
826803
"allOf": [
827804
{
828-
"$ref": "#/definitions/PreBuiltResult"
805+
"$ref": "common.json#/definitions/PreBuiltResult"
829806
}
830807
],
831808
"required": [
@@ -1168,7 +1145,7 @@
11681145
},
11691146
"allOf": [
11701147
{
1171-
"$ref": "#/definitions/PreBuiltResult"
1148+
"$ref": "common.json#/definitions/PreBuiltResult"
11721149
}
11731150
],
11741151
"required": [
@@ -1505,7 +1482,7 @@
15051482
},
15061483
"allOf": [
15071484
{
1508-
"$ref": "#/definitions/PreBuiltResult"
1485+
"$ref": "common.json#/definitions/PreBuiltResult"
15091486
}
15101487
],
15111488
"required": [
@@ -1634,7 +1611,7 @@
16341611
},
16351612
"allOf": [
16361613
{
1637-
"$ref": "#/definitions/PreBuiltResult"
1614+
"$ref": "common.json#/definitions/PreBuiltResult"
16381615
}
16391616
],
16401617
"required": [
@@ -1803,7 +1780,7 @@
18031780
},
18041781
"allOf": [
18051782
{
1806-
"$ref": "#/definitions/PreBuiltResult"
1783+
"$ref": "common.json#/definitions/PreBuiltResult"
18071784
}
18081785
],
18091786
"required": [
@@ -2247,7 +2224,7 @@
22472224
},
22482225
"allOf": [
22492226
{
2250-
"$ref": "#/definitions/PreBuiltResult"
2227+
"$ref": "common.json#/definitions/PreBuiltResult"
22512228
}
22522229
],
22532230
"required": [
@@ -2313,7 +2290,7 @@
23132290
},
23142291
"allOf": [
23152292
{
2316-
"$ref": "#/definitions/PreBuiltResult"
2293+
"$ref": "common.json#/definitions/PreBuiltResult"
23172294
}
23182295
],
23192296
"required": [
@@ -2395,7 +2372,7 @@
23952372
"AnalyzeTextJobStatistics": {
23962373
"properties": {
23972374
"statistics": {
2398-
"$ref": "#/definitions/RequestStatistics"
2375+
"$ref": "common.json#/definitions/RequestStatistics"
23992376
}
24002377
},
24012378
"type": "object"
@@ -2692,24 +2669,6 @@
26922669
}
26932670
}
26942671
},
2695-
"DocumentError": {
2696-
"type": "object",
2697-
"required": [
2698-
"id",
2699-
"error"
2700-
],
2701-
"properties": {
2702-
"id": {
2703-
"type": "string",
2704-
"description": "Document Id."
2705-
},
2706-
"error": {
2707-
"type": "object",
2708-
"description": "Document Error.",
2709-
"$ref": "common.json#/definitions/Error"
2710-
}
2711-
}
2712-
},
27132672
"DocumentWarning": {
27142673
"type": "object",
27152674
"required": [
@@ -2759,38 +2718,6 @@
27592718
},
27602719
"description": "if showStats=true was specified in the request this field will contain information about the document payload."
27612720
},
2762-
"RequestStatistics": {
2763-
"type": "object",
2764-
"required": [
2765-
"documentsCount",
2766-
"validDocumentsCount",
2767-
"erroneousDocumentsCount",
2768-
"transactionsCount"
2769-
],
2770-
"properties": {
2771-
"documentsCount": {
2772-
"type": "integer",
2773-
"format": "int32",
2774-
"description": "Number of documents submitted in the request."
2775-
},
2776-
"validDocumentsCount": {
2777-
"type": "integer",
2778-
"format": "int32",
2779-
"description": "Number of valid documents. This excludes empty, over-size limit or non-supported languages documents."
2780-
},
2781-
"erroneousDocumentsCount": {
2782-
"type": "integer",
2783-
"format": "int32",
2784-
"description": "Number of invalid documents. This includes empty, over-size limit or non-supported languages documents."
2785-
},
2786-
"transactionsCount": {
2787-
"type": "integer",
2788-
"format": "int64",
2789-
"description": "Number of transactions for the request."
2790-
}
2791-
},
2792-
"description": "if showStats=true was specified in the request this field will contain information about the request payload."
2793-
},
27942721
"MultiLanguageInput": {
27952722
"type": "object",
27962723
"description": "Contains an input document to be analyzed by the service.",

0 commit comments

Comments
 (0)