From 06c367a6df6179bfbccf10969c80ab35f16cdb16 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Mon, 8 Jul 2024 15:10:29 +0800 Subject: [PATCH 01/10] fix face --- specification/ai/Face/routes.session.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/ai/Face/routes.session.tsp b/specification/ai/Face/routes.session.tsp index 4c5c59085f75..55af09ddf790 100644 --- a/specification/ai/Face/routes.session.tsp +++ b/specification/ai/Face/routes.session.tsp @@ -102,7 +102,7 @@ interface LivenessSessionOperations { @sharedRoute createLivenessWithVerifySessionWithVerifyImage is FaceResourceCreateWithServiceProvidedName< LivenessWithVerifySession, - CreateLivenessWithVerifySessionContent, + BodyParameter, CreateLivenessWithVerifySessionResult >; From 15b9035cba49fde13df78bff788d0440128dd031 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Mon, 8 Jul 2024 15:54:28 +0800 Subject: [PATCH 02/10] fix communication messages --- .../Communication.Messages/client.tsp | 5 +++++ .../Communication.Messages/models.tsp | 14 +++++--------- .../Communication.Messages/routes.tsp | 2 +- .../communicationservicesmessages.json | 18 +++++++++++------- 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/specification/communication/Communication.Messages/client.tsp b/specification/communication/Communication.Messages/client.tsp index d8c9d9c1f1be..1d6e93f09de5 100644 --- a/specification/communication/Communication.Messages/client.tsp +++ b/specification/communication/Communication.Messages/client.tsp @@ -36,3 +36,8 @@ interface MessageTemplateClient "templateValues", "python" ); + +@@clientName(Azure.Communication.MessagesService.NotificationMessagesSendRequestBody.body, + "notificationContent", + "csharp" +); diff --git a/specification/communication/Communication.Messages/models.tsp b/specification/communication/Communication.Messages/models.tsp index 4949f3b23047..9d9c555ad3ff 100644 --- a/specification/communication/Communication.Messages/models.tsp +++ b/specification/communication/Communication.Messages/models.tsp @@ -375,13 +375,9 @@ enum Versions { c2024_02_01: "2024-02-01", } -alias BodyParameter< - T, - TName extends valueof string = "body", - TDoc extends valueof string = "Body parameter." -> = { - @doc(TDoc) - @friendlyName(TName) +@doc("Notification messages send request body.") +model NotificationMessagesSendRequestBody { + @doc("Details of the message to send.") @bodyRoot - body: T; -}; + body: NotificationContent; +} diff --git a/specification/communication/Communication.Messages/routes.tsp b/specification/communication/Communication.Messages/routes.tsp index a2c5d85987a4..75fc25bf3be6 100644 --- a/specification/communication/Communication.Messages/routes.tsp +++ b/specification/communication/Communication.Messages/routes.tsp @@ -35,7 +35,7 @@ interface NotificationMessagesOperations { @doc("Sends a notification message from Business to User.") send is Operations.ResourceCollectionAction< Notifications, - BodyParameter, + NotificationMessagesSendRequestBody, AcceptedResponse & SendMessageResult >; } diff --git a/specification/communication/data-plane/Messages/stable/2024-02-01/communicationservicesmessages.json b/specification/communication/data-plane/Messages/stable/2024-02-01/communicationservicesmessages.json index ec91ed70c2ed..7a383c60e5d5 100644 --- a/specification/communication/data-plane/Messages/stable/2024-02-01/communicationservicesmessages.json +++ b/specification/communication/data-plane/Messages/stable/2024-02-01/communicationservicesmessages.json @@ -162,13 +162,7 @@ "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" }, { - "name": "body", - "in": "body", - "description": "Body parameter.", - "required": true, - "schema": { - "$ref": "#/definitions/NotificationContent" - } + "$ref": "#/parameters/NotificationMessagesSendRequestBody" } ], "responses": { @@ -1063,6 +1057,16 @@ "type": "string", "x-ms-parameter-location": "method", "x-ms-client-name": "repeatabilityRequestId" + }, + "NotificationMessagesSendRequestBody": { + "name": "body", + "in": "body", + "description": "Details of the message to send.", + "required": true, + "schema": { + "$ref": "#/definitions/NotificationContent" + }, + "x-ms-parameter-location": "method" } } } From e8152ef38738b61f6073d0b7d25c0e45b5e5fb18 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Mon, 8 Jul 2024 16:08:09 +0800 Subject: [PATCH 03/10] regen swagger --- .../Face/preview/v1.1-preview.1/Face.json | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json b/specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json index 9ad89a4484f6..f6a2bb3c0d93 100644 --- a/specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json +++ b/specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json @@ -642,10 +642,31 @@ ], "parameters": [ { - "$ref": "#/parameters/CreateLivenessWithVerifySessionContent.Parameters" + "name": "contentType", + "in": "formData", + "description": "The content type for the operation. Always multipart/form-data for this operation.", + "required": true, + "type": "string", + "enum": [ + "multipart/form-data" + ], + "x-ms-enum": { + "modelAsString": false + } }, { - "$ref": "#/parameters/CreateLivenessWithVerifySessionContent.VerifyImage" + "name": "Parameters", + "in": "formData", + "description": "The parameters for creating session.", + "required": true, + "type": "string" + }, + { + "name": "VerifyImage", + "in": "formData", + "description": "The image stream for verify. Content-Disposition header field for this part must have filename.", + "required": true, + "type": "file" } ], "responses": { @@ -9405,22 +9426,5 @@ "pattern": "^[a-z0-9-_]+$" } }, - "parameters": { - "CreateLivenessWithVerifySessionContent.Parameters": { - "name": "Parameters", - "in": "formData", - "description": "The parameters for creating session.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "CreateLivenessWithVerifySessionContent.VerifyImage": { - "name": "VerifyImage", - "in": "formData", - "description": "The image stream for verify. Content-Disposition header field for this part must have filename.", - "required": true, - "type": "file", - "x-ms-parameter-location": "method" - } - } + "parameters": {} } From 89a5b39b0ae5b9777231139b0bdb24d83e30af2c Mon Sep 17 00:00:00 2001 From: tadelesh Date: Mon, 8 Jul 2024 16:20:47 +0800 Subject: [PATCH 04/10] fix casing --- specification/communication/Communication.Messages/client.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/communication/Communication.Messages/client.tsp b/specification/communication/Communication.Messages/client.tsp index 1d6e93f09de5..b80a489484cb 100644 --- a/specification/communication/Communication.Messages/client.tsp +++ b/specification/communication/Communication.Messages/client.tsp @@ -38,6 +38,6 @@ interface MessageTemplateClient ); @@clientName(Azure.Communication.MessagesService.NotificationMessagesSendRequestBody.body, - "notificationContent", + "NotificationContent", "csharp" ); From 56fd41b79cc66021b3d0604cdac777a020e60a2d Mon Sep 17 00:00:00 2001 From: tadelesh Date: Mon, 8 Jul 2024 16:58:11 +0800 Subject: [PATCH 05/10] rollback face --- specification/ai/Face/routes.session.tsp | 2 +- .../Face/preview/v1.1-preview.1/Face.json | 44 +++++++++---------- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/specification/ai/Face/routes.session.tsp b/specification/ai/Face/routes.session.tsp index 55af09ddf790..4c5c59085f75 100644 --- a/specification/ai/Face/routes.session.tsp +++ b/specification/ai/Face/routes.session.tsp @@ -102,7 +102,7 @@ interface LivenessSessionOperations { @sharedRoute createLivenessWithVerifySessionWithVerifyImage is FaceResourceCreateWithServiceProvidedName< LivenessWithVerifySession, - BodyParameter, + CreateLivenessWithVerifySessionContent, CreateLivenessWithVerifySessionResult >; diff --git a/specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json b/specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json index f6a2bb3c0d93..9ad89a4484f6 100644 --- a/specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json +++ b/specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json @@ -642,31 +642,10 @@ ], "parameters": [ { - "name": "contentType", - "in": "formData", - "description": "The content type for the operation. Always multipart/form-data for this operation.", - "required": true, - "type": "string", - "enum": [ - "multipart/form-data" - ], - "x-ms-enum": { - "modelAsString": false - } + "$ref": "#/parameters/CreateLivenessWithVerifySessionContent.Parameters" }, { - "name": "Parameters", - "in": "formData", - "description": "The parameters for creating session.", - "required": true, - "type": "string" - }, - { - "name": "VerifyImage", - "in": "formData", - "description": "The image stream for verify. Content-Disposition header field for this part must have filename.", - "required": true, - "type": "file" + "$ref": "#/parameters/CreateLivenessWithVerifySessionContent.VerifyImage" } ], "responses": { @@ -9426,5 +9405,22 @@ "pattern": "^[a-z0-9-_]+$" } }, - "parameters": {} + "parameters": { + "CreateLivenessWithVerifySessionContent.Parameters": { + "name": "Parameters", + "in": "formData", + "description": "The parameters for creating session.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "CreateLivenessWithVerifySessionContent.VerifyImage": { + "name": "VerifyImage", + "in": "formData", + "description": "The image stream for verify. Content-Disposition header field for this part must have filename.", + "required": true, + "type": "file", + "x-ms-parameter-location": "method" + } + } } From 232f7aac9acd8b587cc8ba64cf7016095b504d7b Mon Sep 17 00:00:00 2001 From: tadelesh Date: Mon, 8 Jul 2024 18:05:24 +0800 Subject: [PATCH 06/10] fix face --- specification/ai/Face/routes.session.tsp | 2 +- .../Face/preview/v1.1-preview.1/Face.json | 44 ++++++++++--------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/specification/ai/Face/routes.session.tsp b/specification/ai/Face/routes.session.tsp index 4c5c59085f75..55af09ddf790 100644 --- a/specification/ai/Face/routes.session.tsp +++ b/specification/ai/Face/routes.session.tsp @@ -102,7 +102,7 @@ interface LivenessSessionOperations { @sharedRoute createLivenessWithVerifySessionWithVerifyImage is FaceResourceCreateWithServiceProvidedName< LivenessWithVerifySession, - CreateLivenessWithVerifySessionContent, + BodyParameter, CreateLivenessWithVerifySessionResult >; diff --git a/specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json b/specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json index 9ad89a4484f6..f6a2bb3c0d93 100644 --- a/specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json +++ b/specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json @@ -642,10 +642,31 @@ ], "parameters": [ { - "$ref": "#/parameters/CreateLivenessWithVerifySessionContent.Parameters" + "name": "contentType", + "in": "formData", + "description": "The content type for the operation. Always multipart/form-data for this operation.", + "required": true, + "type": "string", + "enum": [ + "multipart/form-data" + ], + "x-ms-enum": { + "modelAsString": false + } }, { - "$ref": "#/parameters/CreateLivenessWithVerifySessionContent.VerifyImage" + "name": "Parameters", + "in": "formData", + "description": "The parameters for creating session.", + "required": true, + "type": "string" + }, + { + "name": "VerifyImage", + "in": "formData", + "description": "The image stream for verify. Content-Disposition header field for this part must have filename.", + "required": true, + "type": "file" } ], "responses": { @@ -9405,22 +9426,5 @@ "pattern": "^[a-z0-9-_]+$" } }, - "parameters": { - "CreateLivenessWithVerifySessionContent.Parameters": { - "name": "Parameters", - "in": "formData", - "description": "The parameters for creating session.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "CreateLivenessWithVerifySessionContent.VerifyImage": { - "name": "VerifyImage", - "in": "formData", - "description": "The image stream for verify. Content-Disposition header field for this part must have filename.", - "required": true, - "type": "file", - "x-ms-parameter-location": "method" - } - } + "parameters": {} } From 14dd4422c6cd77d0625c87bc937aaf2570e3854c Mon Sep 17 00:00:00 2001 From: tadelesh Date: Tue, 9 Jul 2024 10:10:38 +0800 Subject: [PATCH 07/10] fix tsp --- specification/ai/Face/models.session.tsp | 15 +++++++++++---- specification/ai/Face/routes.session.tsp | 2 +- .../Face/preview/v1.1-preview.1/Face.json | 13 ------------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/specification/ai/Face/models.session.tsp b/specification/ai/Face/models.session.tsp index a3cda20247c6..bcf04fe373d2 100644 --- a/specification/ai/Face/models.session.tsp +++ b/specification/ai/Face/models.session.tsp @@ -267,10 +267,6 @@ model LivenessSessionAuditEntry { @doc("Request of liveness with verify session creation.") model CreateLivenessWithVerifySessionContent { - @doc("The content type for the operation. Always multipart/form-data for this operation.") - @header("content-type") - contentType: "multipart/form-data"; - #suppress "@azure-tools/typespec-azure-core/casing-style" @doc("The parameters for creating session.") Parameters: CreateLivenessSessionContent; @@ -279,3 +275,14 @@ model CreateLivenessWithVerifySessionContent { @doc("The image stream for verify. Content-Disposition header field for this part must have filename.") VerifyImage: bytes; } + +@doc("Request wrapper of liveness with verify session creation.") +model CreateLivenessWithVerifySessionRequest { + @doc("The content type for the operation. Always multipart/form-data for this operation.") + @header("content-type") + contentType: "multipart/form-data"; + + @doc("Request content of liveness with verify session creation.") + @body + body: CreateLivenessWithVerifySessionContent; +} diff --git a/specification/ai/Face/routes.session.tsp b/specification/ai/Face/routes.session.tsp index 55af09ddf790..8878172142a5 100644 --- a/specification/ai/Face/routes.session.tsp +++ b/specification/ai/Face/routes.session.tsp @@ -102,7 +102,7 @@ interface LivenessSessionOperations { @sharedRoute createLivenessWithVerifySessionWithVerifyImage is FaceResourceCreateWithServiceProvidedName< LivenessWithVerifySession, - BodyParameter, + CreateLivenessWithVerifySessionRequest, CreateLivenessWithVerifySessionResult >; diff --git a/specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json b/specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json index f6a2bb3c0d93..c2873f6fcae3 100644 --- a/specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json +++ b/specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json @@ -641,19 +641,6 @@ "multipart/form-data" ], "parameters": [ - { - "name": "contentType", - "in": "formData", - "description": "The content type for the operation. Always multipart/form-data for this operation.", - "required": true, - "type": "string", - "enum": [ - "multipart/form-data" - ], - "x-ms-enum": { - "modelAsString": false - } - }, { "name": "Parameters", "in": "formData", From b8ec3841224e5a9a27c128e588b1c387baef6a99 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Tue, 9 Jul 2024 10:28:46 +0800 Subject: [PATCH 08/10] add java --- specification/communication/Communication.Messages/client.tsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/communication/Communication.Messages/client.tsp b/specification/communication/Communication.Messages/client.tsp index b80a489484cb..6fad713a917c 100644 --- a/specification/communication/Communication.Messages/client.tsp +++ b/specification/communication/Communication.Messages/client.tsp @@ -38,6 +38,6 @@ interface MessageTemplateClient ); @@clientName(Azure.Communication.MessagesService.NotificationMessagesSendRequestBody.body, - "NotificationContent", - "csharp" + "notificationContent", + "csharp,java" ); From 354f02dc9d93d0826adfaaeb407308aa35105705 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Tue, 9 Jul 2024 11:21:58 +0800 Subject: [PATCH 09/10] fix easm --- specification/riskiq/Easm/routes.tsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/riskiq/Easm/routes.tsp b/specification/riskiq/Easm/routes.tsp index f8220b541bfb..396f815f0489 100644 --- a/specification/riskiq/Easm/routes.tsp +++ b/specification/riskiq/Easm/routes.tsp @@ -30,7 +30,7 @@ interface Assets { @updatesResource(AssetResource) @post updateAssets is Foundations.Operation< - AssetsUpdateParameter & AssetUpdateData, + AssetsUpdateParameter & BodyParameter, Task >; @doc("Retrieve an asset by assetId.") @@ -242,7 +242,7 @@ interface SavedFilters { @put createOrReplaceSavedFilter is Foundations.ResourceOperation< SavedFilter, - SavedFilterData, + BodyParameter, SavedFilter >; @doc("Delete a saved filter with a given filterName.") From 1c43309c5e794189096ab97ca9cad19501af2872 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Tue, 9 Jul 2024 11:31:31 +0800 Subject: [PATCH 10/10] update swagger --- .../Microsoft.Easm/preview/2023-03-01-preview/easm.json | 2 ++ .../Microsoft.Easm/preview/2024-03-01-preview/easm.json | 2 ++ 2 files changed, 4 insertions(+) diff --git a/specification/riskiq/data-plane/Microsoft.Easm/preview/2023-03-01-preview/easm.json b/specification/riskiq/data-plane/Microsoft.Easm/preview/2023-03-01-preview/easm.json index dd82cf71c089..2979f3851472 100644 --- a/specification/riskiq/data-plane/Microsoft.Easm/preview/2023-03-01-preview/easm.json +++ b/specification/riskiq/data-plane/Microsoft.Easm/preview/2023-03-01-preview/easm.json @@ -145,6 +145,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/AssetUpdateData" @@ -1102,6 +1103,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/SavedFilterData" diff --git a/specification/riskiq/data-plane/Microsoft.Easm/preview/2024-03-01-preview/easm.json b/specification/riskiq/data-plane/Microsoft.Easm/preview/2024-03-01-preview/easm.json index d6f807a38604..dce621013446 100644 --- a/specification/riskiq/data-plane/Microsoft.Easm/preview/2024-03-01-preview/easm.json +++ b/specification/riskiq/data-plane/Microsoft.Easm/preview/2024-03-01-preview/easm.json @@ -157,6 +157,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/AssetUpdateData" @@ -1604,6 +1605,7 @@ { "name": "body", "in": "body", + "description": "Body parameter.", "required": true, "schema": { "$ref": "#/definitions/SavedFilterData"