Skip to content

Commit ad84205

Browse files
authored
fix body spread breaking change (#29723)
* fix face * fix communication messages * regen swagger * fix casing * rollback face * fix face * fix tsp * add java * fix easm
1 parent 73e33d0 commit ad84205

File tree

10 files changed

+51
-44
lines changed

10 files changed

+51
-44
lines changed

specification/ai/Face/models.session.tsp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,6 @@ model LivenessSessionAuditEntry {
267267

268268
@doc("Request of liveness with verify session creation.")
269269
model CreateLivenessWithVerifySessionContent {
270-
@doc("The content type for the operation. Always multipart/form-data for this operation.")
271-
@header("content-type")
272-
contentType: "multipart/form-data";
273-
274270
#suppress "@azure-tools/typespec-azure-core/casing-style"
275271
@doc("The parameters for creating session.")
276272
Parameters: CreateLivenessSessionContent;
@@ -279,3 +275,14 @@ model CreateLivenessWithVerifySessionContent {
279275
@doc("The image stream for verify. Content-Disposition header field for this part must have filename.")
280276
VerifyImage: bytes;
281277
}
278+
279+
@doc("Request wrapper of liveness with verify session creation.")
280+
model CreateLivenessWithVerifySessionRequest {
281+
@doc("The content type for the operation. Always multipart/form-data for this operation.")
282+
@header("content-type")
283+
contentType: "multipart/form-data";
284+
285+
@doc("Request content of liveness with verify session creation.")
286+
@body
287+
body: CreateLivenessWithVerifySessionContent;
288+
}

specification/ai/Face/routes.session.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ interface LivenessSessionOperations {
102102
@sharedRoute
103103
createLivenessWithVerifySessionWithVerifyImage is FaceResourceCreateWithServiceProvidedName<
104104
LivenessWithVerifySession,
105-
CreateLivenessWithVerifySessionContent,
105+
CreateLivenessWithVerifySessionRequest,
106106
CreateLivenessWithVerifySessionResult
107107
>;
108108

specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -642,10 +642,18 @@
642642
],
643643
"parameters": [
644644
{
645-
"$ref": "#/parameters/CreateLivenessWithVerifySessionContent.Parameters"
645+
"name": "Parameters",
646+
"in": "formData",
647+
"description": "The parameters for creating session.",
648+
"required": true,
649+
"type": "string"
646650
},
647651
{
648-
"$ref": "#/parameters/CreateLivenessWithVerifySessionContent.VerifyImage"
652+
"name": "VerifyImage",
653+
"in": "formData",
654+
"description": "The image stream for verify. Content-Disposition header field for this part must have filename.",
655+
"required": true,
656+
"type": "file"
649657
}
650658
],
651659
"responses": {
@@ -9405,22 +9413,5 @@
94059413
"pattern": "^[a-z0-9-_]+$"
94069414
}
94079415
},
9408-
"parameters": {
9409-
"CreateLivenessWithVerifySessionContent.Parameters": {
9410-
"name": "Parameters",
9411-
"in": "formData",
9412-
"description": "The parameters for creating session.",
9413-
"required": true,
9414-
"type": "string",
9415-
"x-ms-parameter-location": "method"
9416-
},
9417-
"CreateLivenessWithVerifySessionContent.VerifyImage": {
9418-
"name": "VerifyImage",
9419-
"in": "formData",
9420-
"description": "The image stream for verify. Content-Disposition header field for this part must have filename.",
9421-
"required": true,
9422-
"type": "file",
9423-
"x-ms-parameter-location": "method"
9424-
}
9425-
}
9416+
"parameters": {}
94269417
}

specification/communication/Communication.Messages/client.tsp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,8 @@ interface MessageTemplateClient
3636
"templateValues",
3737
"python"
3838
);
39+
40+
@@clientName(Azure.Communication.MessagesService.NotificationMessagesSendRequestBody.body,
41+
"notificationContent",
42+
"csharp,java"
43+
);

specification/communication/Communication.Messages/models.tsp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,9 @@ enum Versions {
375375
c2024_02_01: "2024-02-01",
376376
}
377377

378-
alias BodyParameter<
379-
T,
380-
TName extends valueof string = "body",
381-
TDoc extends valueof string = "Body parameter."
382-
> = {
383-
@doc(TDoc)
384-
@friendlyName(TName)
378+
@doc("Notification messages send request body.")
379+
model NotificationMessagesSendRequestBody {
380+
@doc("Details of the message to send.")
385381
@bodyRoot
386-
body: T;
387-
};
382+
body: NotificationContent;
383+
}

specification/communication/Communication.Messages/routes.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ interface NotificationMessagesOperations {
3535
@doc("Sends a notification message from Business to User.")
3636
send is Operations.ResourceCollectionAction<
3737
Notifications,
38-
BodyParameter<NotificationContent>,
38+
NotificationMessagesSendRequestBody,
3939
AcceptedResponse & SendMessageResult
4040
>;
4141
}

specification/communication/data-plane/Messages/stable/2024-02-01/communicationservicesmessages.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,7 @@
162162
"$ref": "#/parameters/Azure.Core.ClientRequestIdHeader"
163163
},
164164
{
165-
"name": "body",
166-
"in": "body",
167-
"description": "Body parameter.",
168-
"required": true,
169-
"schema": {
170-
"$ref": "#/definitions/NotificationContent"
171-
}
165+
"$ref": "#/parameters/NotificationMessagesSendRequestBody"
172166
}
173167
],
174168
"responses": {
@@ -1063,6 +1057,16 @@
10631057
"type": "string",
10641058
"x-ms-parameter-location": "method",
10651059
"x-ms-client-name": "repeatabilityRequestId"
1060+
},
1061+
"NotificationMessagesSendRequestBody": {
1062+
"name": "body",
1063+
"in": "body",
1064+
"description": "Details of the message to send.",
1065+
"required": true,
1066+
"schema": {
1067+
"$ref": "#/definitions/NotificationContent"
1068+
},
1069+
"x-ms-parameter-location": "method"
10661070
}
10671071
}
10681072
}

specification/riskiq/Easm/routes.tsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface Assets {
3030
@updatesResource(AssetResource)
3131
@post
3232
updateAssets is Foundations.Operation<
33-
AssetsUpdateParameter & AssetUpdateData,
33+
AssetsUpdateParameter & BodyParameter<AssetUpdateData>,
3434
Task
3535
>;
3636
@doc("Retrieve an asset by assetId.")
@@ -242,7 +242,7 @@ interface SavedFilters {
242242
@put
243243
createOrReplaceSavedFilter is Foundations.ResourceOperation<
244244
SavedFilter,
245-
SavedFilterData,
245+
BodyParameter<SavedFilterData>,
246246
SavedFilter
247247
>;
248248
@doc("Delete a saved filter with a given filterName.")

specification/riskiq/data-plane/Microsoft.Easm/preview/2023-03-01-preview/easm.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
{
146146
"name": "body",
147147
"in": "body",
148+
"description": "Body parameter.",
148149
"required": true,
149150
"schema": {
150151
"$ref": "#/definitions/AssetUpdateData"
@@ -1102,6 +1103,7 @@
11021103
{
11031104
"name": "body",
11041105
"in": "body",
1106+
"description": "Body parameter.",
11051107
"required": true,
11061108
"schema": {
11071109
"$ref": "#/definitions/SavedFilterData"

specification/riskiq/data-plane/Microsoft.Easm/preview/2024-03-01-preview/easm.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@
157157
{
158158
"name": "body",
159159
"in": "body",
160+
"description": "Body parameter.",
160161
"required": true,
161162
"schema": {
162163
"$ref": "#/definitions/AssetUpdateData"
@@ -1604,6 +1605,7 @@
16041605
{
16051606
"name": "body",
16061607
"in": "body",
1608+
"description": "Body parameter.",
16071609
"required": true,
16081610
"schema": {
16091611
"$ref": "#/definitions/SavedFilterData"

0 commit comments

Comments
 (0)