From 110b1e3d3c9536dab453d0d1a6413c0f494b4f35 Mon Sep 17 00:00:00 2001 From: Arcturus Zhang Date: Thu, 4 Jul 2024 21:15:03 +0800 Subject: [PATCH 01/14] update --- .../Azure.Analytics.Purview.DataMap/routes.tsp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/specification/purview/Azure.Analytics.Purview.DataMap/routes.tsp b/specification/purview/Azure.Analytics.Purview.DataMap/routes.tsp index 7dd2a7fb5645..1c252008eb74 100644 --- a/specification/purview/Azure.Analytics.Purview.DataMap/routes.tsp +++ b/specification/purview/Azure.Analytics.Purview.DataMap/routes.tsp @@ -116,7 +116,7 @@ interface Entity { """) @query collectionId?: string; - } & AtlasEntityWithExtInfo, + } & BodyParameter, EntityMutationResult, AtlasApiVersionParameterTraits >; @@ -174,7 +174,7 @@ interface Entity { """) @query businessAttributeUpdateBehavior?: BusinessAttributeUpdateBehavior; - } & AtlasEntitiesWithExtInfo, + } & BodyParameter, EntityMutationResult, AtlasApiVersionParameterTraits >; @@ -447,7 +447,7 @@ interface Entity { """) @query("attr:qualifiedName") attribute?: string; - } & AtlasEntityWithExtInfo, + } & BodyParameter, EntityMutationResult, {} >; @@ -576,7 +576,7 @@ interface Entity { @route("/atlas/v2/entity/bulk/setClassifications") @post bulkSetClassifications is AtlasOperation< - AtlasEntityHeaders, + BodyParameter, OkResponse, {} >; @@ -765,7 +765,7 @@ interface Entity { @route("/atlas/v2/entity/businessmetadata/import") @post importBusinessMetadata is AtlasImportOperation< - BusinessMetadataOptions, + BodyParameter, BulkImportResult, MultipartFormDataRequestHeadersTraits >; @@ -966,7 +966,7 @@ interface Entity { @doc("The collection where entities will be moved to.") @query collectionId: string; - } & MoveEntitiesOptions, + } & BodyParameter, EntityMutationResult, {}, AtlasErrorResponse From e8b2cde02c70576c8103916c5f37cf5807a8e27d Mon Sep 17 00:00:00 2001 From: Arcturus Zhang Date: Thu, 4 Jul 2024 21:21:40 +0800 Subject: [PATCH 02/14] update --- .../purview/Azure.Analytics.Purview.DataMap/routes.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/purview/Azure.Analytics.Purview.DataMap/routes.tsp b/specification/purview/Azure.Analytics.Purview.DataMap/routes.tsp index 1c252008eb74..9889b527368a 100644 --- a/specification/purview/Azure.Analytics.Purview.DataMap/routes.tsp +++ b/specification/purview/Azure.Analytics.Purview.DataMap/routes.tsp @@ -205,7 +205,7 @@ interface Entity { @doc("Associate a classification to multiple entities in bulk.") @route("/atlas/v2/entity/bulk/classification") @post - addClassification is AtlasOperation; + addClassification is AtlasOperation, void, {}>; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is Atlas API" #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "This is Atlas API, which does not require api version" From 29995a3d7d2e2653ad5385482b9fbe17e9866b2a Mon Sep 17 00:00:00 2001 From: Arcturus Zhang Date: Thu, 4 Jul 2024 21:27:11 +0800 Subject: [PATCH 03/14] update --- .../routes.tsp | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/specification/purview/Azure.Analytics.Purview.DataMap/routes.tsp b/specification/purview/Azure.Analytics.Purview.DataMap/routes.tsp index 9889b527368a..ca5e47f1a63b 100644 --- a/specification/purview/Azure.Analytics.Purview.DataMap/routes.tsp +++ b/specification/purview/Azure.Analytics.Purview.DataMap/routes.tsp @@ -1011,7 +1011,7 @@ interface Glossary { @doc("Create a glossary.") @route("/atlas/v2/glossary") @post - create is AtlasOperation; + create is AtlasOperation, AtlasGlossary, {}>; #suppress "@azure-tools/typespec-azure-core/request-body-problem" "This is Atlas API behavior" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is Atlas API" @@ -1035,7 +1035,7 @@ interface Glossary { @route("/atlas/v2/glossary/category") @post createCategory is AtlasOperation< - AtlasGlossaryCategory, + BodyParameter, AtlasGlossaryCategory, {} >; @@ -1065,7 +1065,7 @@ interface Glossary { @doc("The globally unique identifier of the category.") @path categoryId: string; - } & AtlasGlossaryCategory, + } & BodyParameter, AtlasGlossaryCategory, {} >; @@ -1178,7 +1178,7 @@ interface Glossary { @doc("Whether include term hierarchy") @query includeTermHierarchy?: boolean; - } & AtlasGlossaryTerm, + } & BodyParameter, AtlasGlossaryTerm, {} >; @@ -1210,7 +1210,7 @@ interface Glossary { @doc("Whether include term hierarchy") @query includeTermHierarchy?: boolean; - } & AtlasGlossaryTerm, + } & BodyParameter, AtlasGlossaryTerm, AtlasApiVersionParameterTraits >; @@ -1412,7 +1412,7 @@ interface Glossary { @doc("Whether ignore terms and categories") @query ignoreTermsAndCategories?: boolean; - } & AtlasGlossary, + } & BodyParameter, AtlasGlossary, AtlasApiVersionParameterTraits >; @@ -1752,14 +1752,14 @@ interface Relationship { @doc("Create a new relationship between entities.") @route("/atlas/v2/relationship") @post - create is AtlasOperation; + create is AtlasOperation, AtlasRelationship, {}>; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is Atlas API" #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "This is Atlas API, which does not require api version" @doc("Update an existing relationship between entities.") @route("/atlas/v2/relationship") @put - update is AtlasOperation; + update is AtlasOperation, AtlasRelationship, {}>; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is Atlas API" #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "This is Atlas API, which does not require api version" @@ -2051,7 +2051,7 @@ interface Type { """) @route("/atlas/v2/types/typedefs") @post - bulkCreate is AtlasOperation; + bulkCreate is AtlasOperation, AtlasTypesDef, {}>; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is Atlas API" #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "This is Atlas API, which does not require api version" @@ -2061,14 +2061,14 @@ interface Type { """) @route("/atlas/v2/types/typedefs") @put - bulkUpdate is AtlasOperation; + bulkUpdate is AtlasOperation, AtlasTypesDef, {}>; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is Atlas API" #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "This is Atlas API, which does not require api version" @doc("Delete API for all types in bulk.") @route("/atlas/v2/types/typedefs") @delete - bulkDelete is AtlasOperation; + bulkDelete is AtlasOperation, void, {}>; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is Atlas API" @doc("List all type definitions returned as a list of minimal information header.") From 0509d67319bfe1060ce5057b1c692f776d52daf0 Mon Sep 17 00:00:00 2001 From: Arcturus Zhang Date: Thu, 4 Jul 2024 21:35:28 +0800 Subject: [PATCH 04/14] update translation --- .../translation/Azure.AI.DocumentTranslation/routes.tsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/translation/Azure.AI.DocumentTranslation/routes.tsp b/specification/translation/Azure.AI.DocumentTranslation/routes.tsp index 63a640672fd5..c8a2b5663aa1 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/routes.tsp +++ b/specification/translation/Azure.AI.DocumentTranslation/routes.tsp @@ -21,7 +21,7 @@ interface DocumentTranslationOperations { @route("document:translate") @post documentTranslate is RpcOperation< - DocumentTranslateContent, + BodyParameter, DocumentTranslateResult, ServiceTraits >; @@ -54,7 +54,7 @@ interface DocumentTranslationOperations { @route("/document/batches") @post startTranslation is Azure.Core.Foundations.Operation< - StartTranslationDetails, + BodyParameter, { @doc("Request has been accepted successfully.") @statusCode From a6f625d465f4962520faa536e98453eb96ee6ba2 Mon Sep 17 00:00:00 2001 From: Arcturus Zhang Date: Thu, 4 Jul 2024 21:37:44 +0800 Subject: [PATCH 05/14] update --- .../Azure.AI.DocumentTranslation/models.tsp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/specification/translation/Azure.AI.DocumentTranslation/models.tsp b/specification/translation/Azure.AI.DocumentTranslation/models.tsp index 98f36a54789c..bb9600d87036 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/models.tsp +++ b/specification/translation/Azure.AI.DocumentTranslation/models.tsp @@ -470,3 +470,14 @@ model FileFormat { @doc("Supported Type for this format") type?: string; } + +alias BodyParameter< + T, + TName extends valueof string = "body", + TDoc extends valueof string = "Body parameter." +> = { + @doc(TDoc) + @friendlyName(TName) + @bodyRoot + body: T; +}; From fdab4158ab7bc1efdaadc4fdaef44a5ea0d7e8c6 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Mon, 8 Jul 2024 15:25:39 +0800 Subject: [PATCH 06/14] fix ai document translation --- .../Azure.AI.DocumentTranslation/client.tsp | 10 +++++++++ .../Azure.AI.DocumentTranslation/models.tsp | 21 +++++++++++-------- .../Azure.AI.DocumentTranslation/routes.tsp | 4 ++-- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/specification/translation/Azure.AI.DocumentTranslation/client.tsp b/specification/translation/Azure.AI.DocumentTranslation/client.tsp index 0eb76c501974..121ca660a59a 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/client.tsp +++ b/specification/translation/Azure.AI.DocumentTranslation/client.tsp @@ -77,3 +77,13 @@ interface SingleDocumentTranslationClient { @@access(DocumentTranslation.DocumentsStatus, Access.internal, "python"); @@access(DocumentTranslation.SupportedFileFormats, Access.internal, "python"); @@access(DocumentTranslation.FileFormat, Access.internal, "python"); + +@@clientName(DocumentTranslation.DocumentTranslateBody.body, + "documentTranslateContent", + "csharp,java" +); + +@@clientName(DocumentTranslation.StartTranslationBody.body, + "startTranslationDetails", + "csharp,java" +); diff --git a/specification/translation/Azure.AI.DocumentTranslation/models.tsp b/specification/translation/Azure.AI.DocumentTranslation/models.tsp index bb9600d87036..4f124848073a 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/models.tsp +++ b/specification/translation/Azure.AI.DocumentTranslation/models.tsp @@ -471,13 +471,16 @@ model FileFormat { type?: string; } -alias BodyParameter< - T, - TName extends valueof string = "body", - TDoc extends valueof string = "Body parameter." -> = { - @doc(TDoc) - @friendlyName(TName) +@doc("Document Translate Request Body") +model DocumentTranslateBody { + @doc("Document Translate Request Content") @bodyRoot - body: T; -}; + body: DocumentTranslateContent; +} + +@doc("Start Translation Request Body") +model StartTranslationBody { + @doc("Translation job submission batch request") + @bodyRoot + body: StartTranslationDetails; +} diff --git a/specification/translation/Azure.AI.DocumentTranslation/routes.tsp b/specification/translation/Azure.AI.DocumentTranslation/routes.tsp index c8a2b5663aa1..4b556b6496dc 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/routes.tsp +++ b/specification/translation/Azure.AI.DocumentTranslation/routes.tsp @@ -21,7 +21,7 @@ interface DocumentTranslationOperations { @route("document:translate") @post documentTranslate is RpcOperation< - BodyParameter, + DocumentTranslateBody, DocumentTranslateResult, ServiceTraits >; @@ -54,7 +54,7 @@ interface DocumentTranslationOperations { @route("/document/batches") @post startTranslation is Azure.Core.Foundations.Operation< - BodyParameter, + StartTranslationBody, { @doc("Request has been accepted successfully.") @statusCode From c8f326f5de83b0d6328f8d84c5dd2a14f8f4310b Mon Sep 17 00:00:00 2001 From: tadelesh Date: Mon, 8 Jul 2024 16:49:59 +0800 Subject: [PATCH 07/14] fix wrong change and regen --- .../Azure.AI.DocumentTranslation/client.tsp | 9 ++------- .../Azure.AI.DocumentTranslation/models.tsp | 7 ------- .../Azure.AI.DocumentTranslation/routes.tsp | 2 +- .../stable/2024-05-01/openapi.json | 17 +++++++++++------ 4 files changed, 14 insertions(+), 21 deletions(-) diff --git a/specification/translation/Azure.AI.DocumentTranslation/client.tsp b/specification/translation/Azure.AI.DocumentTranslation/client.tsp index 121ca660a59a..4206ca389c13 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/client.tsp +++ b/specification/translation/Azure.AI.DocumentTranslation/client.tsp @@ -78,12 +78,7 @@ interface SingleDocumentTranslationClient { @@access(DocumentTranslation.SupportedFileFormats, Access.internal, "python"); @@access(DocumentTranslation.FileFormat, Access.internal, "python"); -@@clientName(DocumentTranslation.DocumentTranslateBody.body, - "documentTranslateContent", - "csharp,java" -); - @@clientName(DocumentTranslation.StartTranslationBody.body, - "startTranslationDetails", - "csharp,java" + "StartTranslationDetails", + "csharp" ); diff --git a/specification/translation/Azure.AI.DocumentTranslation/models.tsp b/specification/translation/Azure.AI.DocumentTranslation/models.tsp index 4f124848073a..8e5916bf0721 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/models.tsp +++ b/specification/translation/Azure.AI.DocumentTranslation/models.tsp @@ -471,13 +471,6 @@ model FileFormat { type?: string; } -@doc("Document Translate Request Body") -model DocumentTranslateBody { - @doc("Document Translate Request Content") - @bodyRoot - body: DocumentTranslateContent; -} - @doc("Start Translation Request Body") model StartTranslationBody { @doc("Translation job submission batch request") diff --git a/specification/translation/Azure.AI.DocumentTranslation/routes.tsp b/specification/translation/Azure.AI.DocumentTranslation/routes.tsp index 4b556b6496dc..c13de63b39cf 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/routes.tsp +++ b/specification/translation/Azure.AI.DocumentTranslation/routes.tsp @@ -21,7 +21,7 @@ interface DocumentTranslationOperations { @route("document:translate") @post documentTranslate is RpcOperation< - DocumentTranslateBody, + DocumentTranslateContent, DocumentTranslateResult, ServiceTraits >; diff --git a/specification/translation/data-plane/Azure.AI.DocumentTranslation/stable/2024-05-01/openapi.json b/specification/translation/data-plane/Azure.AI.DocumentTranslation/stable/2024-05-01/openapi.json index 999176fb42ad..31a6b4cb076d 100644 --- a/specification/translation/data-plane/Azure.AI.DocumentTranslation/stable/2024-05-01/openapi.json +++ b/specification/translation/data-plane/Azure.AI.DocumentTranslation/stable/2024-05-01/openapi.json @@ -189,12 +189,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/StartTranslationDetails" - } + "$ref": "#/parameters/StartTranslationBody" } ], "responses": { @@ -1464,6 +1459,16 @@ "required": true, "type": "string", "x-ms-parameter-location": "method" + }, + "StartTranslationBody": { + "name": "body", + "in": "body", + "description": "Translation job submission batch request", + "required": true, + "schema": { + "$ref": "#/definitions/StartTranslationDetails" + }, + "x-ms-parameter-location": "method" } } } From dc558680c1abf40f097acaa92664c4a4bcea3aa5 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Mon, 8 Jul 2024 18:24:28 +0800 Subject: [PATCH 08/14] fix --- .../Azure.AI.DocumentTranslation/client.tsp | 5 + .../Azure.AI.DocumentTranslation/models.tsp | 7 + .../Azure.AI.DocumentTranslation/routes.tsp | 2 +- .../stable/2024-05-01/openapi.json | 191 ++++++++++++------ 4 files changed, 144 insertions(+), 61 deletions(-) diff --git a/specification/translation/Azure.AI.DocumentTranslation/client.tsp b/specification/translation/Azure.AI.DocumentTranslation/client.tsp index 4206ca389c13..4866aac112f9 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/client.tsp +++ b/specification/translation/Azure.AI.DocumentTranslation/client.tsp @@ -78,6 +78,11 @@ interface SingleDocumentTranslationClient { @@access(DocumentTranslation.SupportedFileFormats, Access.internal, "python"); @@access(DocumentTranslation.FileFormat, Access.internal, "python"); +@@clientName(DocumentTranslation.DocumentTranslateBody.body, + "DocumentTranslateContent", + "csharp" +); + @@clientName(DocumentTranslation.StartTranslationBody.body, "StartTranslationDetails", "csharp" diff --git a/specification/translation/Azure.AI.DocumentTranslation/models.tsp b/specification/translation/Azure.AI.DocumentTranslation/models.tsp index 8e5916bf0721..4f124848073a 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/models.tsp +++ b/specification/translation/Azure.AI.DocumentTranslation/models.tsp @@ -471,6 +471,13 @@ model FileFormat { type?: string; } +@doc("Document Translate Request Body") +model DocumentTranslateBody { + @doc("Document Translate Request Content") + @bodyRoot + body: DocumentTranslateContent; +} + @doc("Start Translation Request Body") model StartTranslationBody { @doc("Translation job submission batch request") diff --git a/specification/translation/Azure.AI.DocumentTranslation/routes.tsp b/specification/translation/Azure.AI.DocumentTranslation/routes.tsp index c13de63b39cf..4b556b6496dc 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/routes.tsp +++ b/specification/translation/Azure.AI.DocumentTranslation/routes.tsp @@ -21,7 +21,7 @@ interface DocumentTranslationOperations { @route("document:translate") @post documentTranslate is RpcOperation< - DocumentTranslateContent, + DocumentTranslateBody, DocumentTranslateResult, ServiceTraits >; diff --git a/specification/translation/data-plane/Azure.AI.DocumentTranslation/stable/2024-05-01/openapi.json b/specification/translation/data-plane/Azure.AI.DocumentTranslation/stable/2024-05-01/openapi.json index 31a6b4cb076d..5ce63bfaddad 100644 --- a/specification/translation/data-plane/Azure.AI.DocumentTranslation/stable/2024-05-01/openapi.json +++ b/specification/translation/data-plane/Azure.AI.DocumentTranslation/stable/2024-05-01/openapi.json @@ -572,25 +572,96 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "$ref": "#/parameters/DocumentTranslateContent.sourceLanguage" + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" }, { - "$ref": "#/parameters/DocumentTranslateContent.targetLanguage" + "name": "sourceLanguage", + "in": "query", + "description": "Specifies source language of the input document.\nIf this parameter isn't specified, automatic language detection is applied to determine the source language.\nFor example if the source document is written in English, then use sourceLanguage=en", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/DocumentTranslateContent.category" + "name": "targetLanguage", + "in": "query", + "description": "Specifies the language of the output document.\nThe target language must be one of the supported languages included in the translation scope.\nFor example if you want to translate the document in German language, then use targetLanguage=de ", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/DocumentTranslateContent.allowFallback" + "name": "category", + "in": "query", + "description": "A string specifying the category (domain) of the translation. This parameter is used to get translations \nfrom a customized system built with Custom Translator. Add the Category ID from your Custom Translator \nproject details to this parameter to use your deployed customized system. Default value is: general.", + "required": false, + "type": "string", + "default": "general" }, { - "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + "name": "allowFallback", + "in": "query", + "description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \nPossible values are: true (default) or false.", + "required": false, + "type": "boolean" }, { - "$ref": "#/parameters/DocumentTranslateContent.document" + "name": "sourceLanguage", + "in": "formData", + "description": "Specifies source language of the input document.\nIf this parameter isn't specified, automatic language detection is applied to determine the source language.\nFor example if the source document is written in English, then use sourceLanguage=en", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/DocumentTranslateContent.glossary" + "name": "targetLanguage", + "in": "formData", + "description": "Specifies the language of the output document.\nThe target language must be one of the supported languages included in the translation scope.\nFor example if you want to translate the document in German language, then use targetLanguage=de ", + "required": true, + "type": "string" + }, + { + "name": "category", + "in": "formData", + "description": "A string specifying the category (domain) of the translation. This parameter is used to get translations \nfrom a customized system built with Custom Translator. Add the Category ID from your Custom Translator \nproject details to this parameter to use your deployed customized system. Default value is: general.", + "required": false, + "type": "string", + "default": "general" + }, + { + "name": "allowFallback", + "in": "formData", + "description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \nPossible values are: true (default) or false.", + "required": false, + "type": "boolean" + }, + { + "name": "contentType", + "in": "formData", + "description": "Content Type as multipart/form-data", + "required": true, + "type": "string", + "enum": [ + "multipart/form-data" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + { + "name": "document", + "in": "formData", + "description": "Document to be translated in the form", + "required": true, + "type": "file" + }, + { + "name": "glossary", + "in": "formData", + "description": "Glossary-translation memory will be used during translation in the form. ", + "required": false, + "type": "array", + "items": { + "type": "string", + "format": "binary" + } } ], "responses": { @@ -819,7 +890,60 @@ "id" ] }, + "DocumentTranslateBody": { + "type": "object", + "description": "Document Translate Request Body", + "properties": { + "body": { + "$ref": "#/definitions/DocumentTranslateContent", + "description": "Document Translate Request Content" + } + }, + "required": [ + "body" + ] + }, "DocumentTranslateContent": { + "type": "object", + "description": "Document Translate Request Content", + "properties": { + "sourceLanguage": { + "type": "string", + "description": "Specifies source language of the input document.\nIf this parameter isn't specified, automatic language detection is applied to determine the source language.\nFor example if the source document is written in English, then use sourceLanguage=en" + }, + "targetLanguage": { + "type": "string", + "description": "Specifies the language of the output document.\nThe target language must be one of the supported languages included in the translation scope.\nFor example if you want to translate the document in German language, then use targetLanguage=de " + }, + "category": { + "type": "string", + "description": "A string specifying the category (domain) of the translation. This parameter is used to get translations \nfrom a customized system built with Custom Translator. Add the Category ID from your Custom Translator \nproject details to this parameter to use your deployed customized system. Default value is: general.", + "default": "general" + }, + "allowFallback": { + "type": "boolean", + "description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \nPossible values are: true (default) or false." + }, + "document": { + "type": "string", + "format": "byte", + "description": "Document to be translated in the form" + }, + "glossary": { + "type": "array", + "description": "Glossary-translation memory will be used during translation in the form. ", + "items": { + "type": "string", + "format": "byte" + } + } + }, + "required": [ + "targetLanguage", + "document" + ] + }, + "DocumentTranslateContentCreate": { "type": "object", "description": "Document Translate Request Content", "properties": { @@ -1407,59 +1531,6 @@ "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" }, - "DocumentTranslateContent.allowFallback": { - "name": "allowFallback", - "in": "query", - "description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \nPossible values are: true (default) or false.", - "required": false, - "type": "boolean", - "x-ms-parameter-location": "method" - }, - "DocumentTranslateContent.category": { - "name": "category", - "in": "query", - "description": "A string specifying the category (domain) of the translation. This parameter is used to get translations \nfrom a customized system built with Custom Translator. Add the Category ID from your Custom Translator \nproject details to this parameter to use your deployed customized system. Default value is: general.", - "required": false, - "type": "string", - "default": "general", - "x-ms-parameter-location": "method" - }, - "DocumentTranslateContent.document": { - "name": "document", - "in": "formData", - "description": "Document to be translated in the form", - "required": true, - "type": "file", - "x-ms-parameter-location": "method" - }, - "DocumentTranslateContent.glossary": { - "name": "glossary", - "in": "formData", - "description": "Glossary-translation memory will be used during translation in the form. ", - "required": false, - "type": "array", - "items": { - "type": "string", - "format": "binary" - }, - "x-ms-parameter-location": "method" - }, - "DocumentTranslateContent.sourceLanguage": { - "name": "sourceLanguage", - "in": "query", - "description": "Specifies source language of the input document.\nIf this parameter isn't specified, automatic language detection is applied to determine the source language.\nFor example if the source document is written in English, then use sourceLanguage=en", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "DocumentTranslateContent.targetLanguage": { - "name": "targetLanguage", - "in": "query", - "description": "Specifies the language of the output document.\nThe target language must be one of the supported languages included in the translation scope.\nFor example if you want to translate the document in German language, then use targetLanguage=de ", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, "StartTranslationBody": { "name": "body", "in": "body", From 0d422eda9f627919fc203131601e4ca8b268d297 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Mon, 8 Jul 2024 18:31:04 +0800 Subject: [PATCH 09/14] update swagger --- .../stable/2023-09-01/purviewdatamap.json | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/specification/purview/data-plane/Azure.Analytics.Purview.DataMap/stable/2023-09-01/purviewdatamap.json b/specification/purview/data-plane/Azure.Analytics.Purview.DataMap/stable/2023-09-01/purviewdatamap.json index 2d8ab19b2b35..4acce1bf0f2f 100644 --- a/specification/purview/data-plane/Azure.Analytics.Purview.DataMap/stable/2023-09-01/purviewdatamap.json +++ b/specification/purview/data-plane/Azure.Analytics.Purview.DataMap/stable/2023-09-01/purviewdatamap.json @@ -101,6 +101,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/AtlasEntityWithExtInfo" @@ -241,6 +242,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/AtlasEntitiesWithExtInfo" @@ -312,6 +314,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/ClassificationAssociateOptions" @@ -344,6 +347,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/AtlasEntityHeaders" @@ -438,7 +442,11 @@ ], "parameters": [ { - "$ref": "#/parameters/BusinessMetadataOptions" + "name": "file", + "in": "formData", + "description": "InputStream of file", + "required": true, + "type": "file" } ], "responses": { @@ -1237,6 +1245,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/AtlasEntityWithExtInfo" @@ -1671,6 +1680,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/AtlasGlossary" @@ -1755,6 +1765,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/AtlasGlossary" @@ -2203,6 +2214,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/AtlasGlossaryCategory" @@ -2277,6 +2289,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/AtlasGlossaryCategory" @@ -2519,6 +2532,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/AtlasGlossaryTerm" @@ -2612,6 +2626,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/AtlasGlossaryTerm" @@ -3156,6 +3171,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/AtlasRelationship" @@ -3189,6 +3205,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/AtlasRelationship" @@ -3915,6 +3932,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/AtlasTypesDef" @@ -3948,6 +3966,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/AtlasTypesDef" @@ -3984,6 +4003,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/AtlasTypesDef" @@ -4142,6 +4162,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/MoveEntitiesOptions" @@ -8241,14 +8262,6 @@ "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" - }, - "BusinessMetadataOptions": { - "name": "file", - "in": "formData", - "description": "InputStream of file", - "required": true, - "type": "file", - "x-ms-parameter-location": "method" } } } From a4ba0af218ec473aa489b147f7d280b9f1614a25 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Tue, 9 Jul 2024 08:38:33 +0800 Subject: [PATCH 10/14] update --- .../Azure.AI.DocumentTranslation/models.tsp | 70 ++++---- .../stable/2024-05-01/openapi.json | 155 +++++------------- 2 files changed, 73 insertions(+), 152 deletions(-) diff --git a/specification/translation/Azure.AI.DocumentTranslation/models.tsp b/specification/translation/Azure.AI.DocumentTranslation/models.tsp index 4f124848073a..7b65b5816cc5 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/models.tsp +++ b/specification/translation/Azure.AI.DocumentTranslation/models.tsp @@ -10,41 +10,6 @@ using TypeSpec.Versioning; namespace DocumentTranslation; @doc("Document Translate Request Content") model DocumentTranslateContent { - @doc(""" - Specifies source language of the input document. - If this parameter isn't specified, automatic language detection is applied to determine the source language. - For example if the source document is written in English, then use sourceLanguage=en - """) - @query("sourceLanguage") - sourceLanguage?: string; - - @doc(""" - Specifies the language of the output document. - The target language must be one of the supported languages included in the translation scope. - For example if you want to translate the document in German language, then use targetLanguage=de - """) - @query("targetLanguage") - targetLanguage: string; - - @doc(""" - A string specifying the category (domain) of the translation. This parameter is used to get translations - from a customized system built with Custom Translator. Add the Category ID from your Custom Translator - project details to this parameter to use your deployed customized system. Default value is: general. - """) - @query("category") - category?: string = "general"; - - @doc(""" - Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. - Possible values are: true (default) or false. - """) - @query("allowFallback") - allowFallback?: boolean; - - @doc("Content Type as multipart/form-data") - @header - contentType: "multipart/form-data"; - @doc("Document to be translated in the form") document: bytes; @@ -473,6 +438,41 @@ model FileFormat { @doc("Document Translate Request Body") model DocumentTranslateBody { + @doc(""" + Specifies source language of the input document. + If this parameter isn't specified, automatic language detection is applied to determine the source language. + For example if the source document is written in English, then use sourceLanguage=en + """) + @query("sourceLanguage") + sourceLanguage?: string; + + @doc(""" + Specifies the language of the output document. + The target language must be one of the supported languages included in the translation scope. + For example if you want to translate the document in German language, then use targetLanguage=de + """) + @query("targetLanguage") + targetLanguage: string; + + @doc(""" + A string specifying the category (domain) of the translation. This parameter is used to get translations + from a customized system built with Custom Translator. Add the Category ID from your Custom Translator + project details to this parameter to use your deployed customized system. Default value is: general. + """) + @query("category") + category?: string = "general"; + + @doc(""" + Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. + Possible values are: true (default) or false. + """) + @query("allowFallback") + allowFallback?: boolean; + + @doc("Content Type as multipart/form-data") + @header + contentType: "multipart/form-data"; + @doc("Document Translate Request Content") @bodyRoot body: DocumentTranslateContent; diff --git a/specification/translation/data-plane/Azure.AI.DocumentTranslation/stable/2024-05-01/openapi.json b/specification/translation/data-plane/Azure.AI.DocumentTranslation/stable/2024-05-01/openapi.json index 5ce63bfaddad..a24e8fa059f0 100644 --- a/specification/translation/data-plane/Azure.AI.DocumentTranslation/stable/2024-05-01/openapi.json +++ b/specification/translation/data-plane/Azure.AI.DocumentTranslation/stable/2024-05-01/openapi.json @@ -572,78 +572,19 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" - }, - { - "name": "sourceLanguage", - "in": "query", - "description": "Specifies source language of the input document.\nIf this parameter isn't specified, automatic language detection is applied to determine the source language.\nFor example if the source document is written in English, then use sourceLanguage=en", - "required": false, - "type": "string" - }, - { - "name": "targetLanguage", - "in": "query", - "description": "Specifies the language of the output document.\nThe target language must be one of the supported languages included in the translation scope.\nFor example if you want to translate the document in German language, then use targetLanguage=de ", - "required": true, - "type": "string" - }, - { - "name": "category", - "in": "query", - "description": "A string specifying the category (domain) of the translation. This parameter is used to get translations \nfrom a customized system built with Custom Translator. Add the Category ID from your Custom Translator \nproject details to this parameter to use your deployed customized system. Default value is: general.", - "required": false, - "type": "string", - "default": "general" - }, - { - "name": "allowFallback", - "in": "query", - "description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \nPossible values are: true (default) or false.", - "required": false, - "type": "boolean" - }, - { - "name": "sourceLanguage", - "in": "formData", - "description": "Specifies source language of the input document.\nIf this parameter isn't specified, automatic language detection is applied to determine the source language.\nFor example if the source document is written in English, then use sourceLanguage=en", - "required": false, - "type": "string" + "$ref": "#/parameters/DocumentTranslateBody.sourceLanguage" }, { - "name": "targetLanguage", - "in": "formData", - "description": "Specifies the language of the output document.\nThe target language must be one of the supported languages included in the translation scope.\nFor example if you want to translate the document in German language, then use targetLanguage=de ", - "required": true, - "type": "string" + "$ref": "#/parameters/DocumentTranslateBody.targetLanguage" }, { - "name": "category", - "in": "formData", - "description": "A string specifying the category (domain) of the translation. This parameter is used to get translations \nfrom a customized system built with Custom Translator. Add the Category ID from your Custom Translator \nproject details to this parameter to use your deployed customized system. Default value is: general.", - "required": false, - "type": "string", - "default": "general" + "$ref": "#/parameters/DocumentTranslateBody.category" }, { - "name": "allowFallback", - "in": "formData", - "description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \nPossible values are: true (default) or false.", - "required": false, - "type": "boolean" + "$ref": "#/parameters/DocumentTranslateBody.allowFallback" }, { - "name": "contentType", - "in": "formData", - "description": "Content Type as multipart/form-data", - "required": true, - "type": "string", - "enum": [ - "multipart/form-data" - ], - "x-ms-enum": { - "modelAsString": false - } + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" }, { "name": "document", @@ -890,60 +831,7 @@ "id" ] }, - "DocumentTranslateBody": { - "type": "object", - "description": "Document Translate Request Body", - "properties": { - "body": { - "$ref": "#/definitions/DocumentTranslateContent", - "description": "Document Translate Request Content" - } - }, - "required": [ - "body" - ] - }, "DocumentTranslateContent": { - "type": "object", - "description": "Document Translate Request Content", - "properties": { - "sourceLanguage": { - "type": "string", - "description": "Specifies source language of the input document.\nIf this parameter isn't specified, automatic language detection is applied to determine the source language.\nFor example if the source document is written in English, then use sourceLanguage=en" - }, - "targetLanguage": { - "type": "string", - "description": "Specifies the language of the output document.\nThe target language must be one of the supported languages included in the translation scope.\nFor example if you want to translate the document in German language, then use targetLanguage=de " - }, - "category": { - "type": "string", - "description": "A string specifying the category (domain) of the translation. This parameter is used to get translations \nfrom a customized system built with Custom Translator. Add the Category ID from your Custom Translator \nproject details to this parameter to use your deployed customized system. Default value is: general.", - "default": "general" - }, - "allowFallback": { - "type": "boolean", - "description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \nPossible values are: true (default) or false." - }, - "document": { - "type": "string", - "format": "byte", - "description": "Document to be translated in the form" - }, - "glossary": { - "type": "array", - "description": "Glossary-translation memory will be used during translation in the form. ", - "items": { - "type": "string", - "format": "byte" - } - } - }, - "required": [ - "targetLanguage", - "document" - ] - }, - "DocumentTranslateContentCreate": { "type": "object", "description": "Document Translate Request Content", "properties": { @@ -1531,6 +1419,39 @@ "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" }, + "DocumentTranslateBody.allowFallback": { + "name": "allowFallback", + "in": "query", + "description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \nPossible values are: true (default) or false.", + "required": false, + "type": "boolean", + "x-ms-parameter-location": "method" + }, + "DocumentTranslateBody.category": { + "name": "category", + "in": "query", + "description": "A string specifying the category (domain) of the translation. This parameter is used to get translations \nfrom a customized system built with Custom Translator. Add the Category ID from your Custom Translator \nproject details to this parameter to use your deployed customized system. Default value is: general.", + "required": false, + "type": "string", + "default": "general", + "x-ms-parameter-location": "method" + }, + "DocumentTranslateBody.sourceLanguage": { + "name": "sourceLanguage", + "in": "query", + "description": "Specifies source language of the input document.\nIf this parameter isn't specified, automatic language detection is applied to determine the source language.\nFor example if the source document is written in English, then use sourceLanguage=en", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "DocumentTranslateBody.targetLanguage": { + "name": "targetLanguage", + "in": "query", + "description": "Specifies the language of the output document.\nThe target language must be one of the supported languages included in the translation scope.\nFor example if you want to translate the document in German language, then use targetLanguage=de ", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, "StartTranslationBody": { "name": "body", "in": "body", From 4079041daa01498ea9a01592ff908a5108fd1ae3 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Tue, 9 Jul 2024 08:44:10 +0800 Subject: [PATCH 11/14] format --- .../Azure.Analytics.Purview.DataMap/routes.tsp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/specification/purview/Azure.Analytics.Purview.DataMap/routes.tsp b/specification/purview/Azure.Analytics.Purview.DataMap/routes.tsp index ca5e47f1a63b..b0bce3569d39 100644 --- a/specification/purview/Azure.Analytics.Purview.DataMap/routes.tsp +++ b/specification/purview/Azure.Analytics.Purview.DataMap/routes.tsp @@ -205,7 +205,11 @@ interface Entity { @doc("Associate a classification to multiple entities in bulk.") @route("/atlas/v2/entity/bulk/classification") @post - addClassification is AtlasOperation, void, {}>; + addClassification is AtlasOperation< + BodyParameter, + void, + {} + >; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is Atlas API" #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "This is Atlas API, which does not require api version" @@ -1752,14 +1756,22 @@ interface Relationship { @doc("Create a new relationship between entities.") @route("/atlas/v2/relationship") @post - create is AtlasOperation, AtlasRelationship, {}>; + create is AtlasOperation< + BodyParameter, + AtlasRelationship, + {} + >; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is Atlas API" #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "This is Atlas API, which does not require api version" @doc("Update an existing relationship between entities.") @route("/atlas/v2/relationship") @put - update is AtlasOperation, AtlasRelationship, {}>; + update is AtlasOperation< + BodyParameter, + AtlasRelationship, + {} + >; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is Atlas API" #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "This is Atlas API, which does not require api version" From f8a126cc3c50d6b2f66a147177c0b3553ec4f52b Mon Sep 17 00:00:00 2001 From: tadelesh Date: Tue, 9 Jul 2024 09:57:21 +0800 Subject: [PATCH 12/14] change to use @body --- .../translation/Azure.AI.DocumentTranslation/models.tsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/translation/Azure.AI.DocumentTranslation/models.tsp b/specification/translation/Azure.AI.DocumentTranslation/models.tsp index 7b65b5816cc5..4218628e6ab8 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/models.tsp +++ b/specification/translation/Azure.AI.DocumentTranslation/models.tsp @@ -474,13 +474,13 @@ model DocumentTranslateBody { contentType: "multipart/form-data"; @doc("Document Translate Request Content") - @bodyRoot + @body body: DocumentTranslateContent; } @doc("Start Translation Request Body") model StartTranslationBody { @doc("Translation job submission batch request") - @bodyRoot + @body body: StartTranslationDetails; } From bd246a654089bc08bbb99f1dbf2c35755a51e40b Mon Sep 17 00:00:00 2001 From: tadelesh Date: Tue, 9 Jul 2024 10:33:11 +0800 Subject: [PATCH 13/14] update --- .../translation/Azure.AI.DocumentTranslation/client.tsp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/translation/Azure.AI.DocumentTranslation/client.tsp b/specification/translation/Azure.AI.DocumentTranslation/client.tsp index 4866aac112f9..121ca660a59a 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/client.tsp +++ b/specification/translation/Azure.AI.DocumentTranslation/client.tsp @@ -79,11 +79,11 @@ interface SingleDocumentTranslationClient { @@access(DocumentTranslation.FileFormat, Access.internal, "python"); @@clientName(DocumentTranslation.DocumentTranslateBody.body, - "DocumentTranslateContent", - "csharp" + "documentTranslateContent", + "csharp,java" ); @@clientName(DocumentTranslation.StartTranslationBody.body, - "StartTranslationDetails", - "csharp" + "startTranslationDetails", + "csharp,java" ); From 4c890d641ae4396ee7796d955d627c81893e77c0 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Tue, 9 Jul 2024 10:45:02 +0800 Subject: [PATCH 14/14] format --- .../translation/Azure.AI.DocumentTranslation/models.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/translation/Azure.AI.DocumentTranslation/models.tsp b/specification/translation/Azure.AI.DocumentTranslation/models.tsp index 4218628e6ab8..892e598176b8 100644 --- a/specification/translation/Azure.AI.DocumentTranslation/models.tsp +++ b/specification/translation/Azure.AI.DocumentTranslation/models.tsp @@ -472,7 +472,7 @@ model DocumentTranslateBody { @doc("Content Type as multipart/form-data") @header contentType: "multipart/form-data"; - + @doc("Document Translate Request Content") @body body: DocumentTranslateContent;