Skip to content

Commit

Permalink
fix body spread breaking change (#29723)
Browse files Browse the repository at this point in the history
* fix face

* fix communication messages

* regen swagger

* fix casing

* rollback face

* fix face

* fix tsp

* add java

* fix easm
  • Loading branch information
tadelesh authored Jul 9, 2024
1 parent 73e33d0 commit ad84205
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 44 deletions.
15 changes: 11 additions & 4 deletions specification/ai/Face/models.session.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
2 changes: 1 addition & 1 deletion specification/ai/Face/routes.session.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ interface LivenessSessionOperations {
@sharedRoute
createLivenessWithVerifySessionWithVerifyImage is FaceResourceCreateWithServiceProvidedName<
LivenessWithVerifySession,
CreateLivenessWithVerifySessionContent,
CreateLivenessWithVerifySessionRequest,
CreateLivenessWithVerifySessionResult
>;

Expand Down
31 changes: 11 additions & 20 deletions specification/ai/data-plane/Face/preview/v1.1-preview.1/Face.json
Original file line number Diff line number Diff line change
Expand Up @@ -642,10 +642,18 @@
],
"parameters": [
{
"$ref": "#/parameters/CreateLivenessWithVerifySessionContent.Parameters"
"name": "Parameters",
"in": "formData",
"description": "The parameters for creating session.",
"required": true,
"type": "string"
},
{
"$ref": "#/parameters/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"
}
],
"responses": {
Expand Down Expand Up @@ -9405,22 +9413,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": {}
}
5 changes: 5 additions & 0 deletions specification/communication/Communication.Messages/client.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ interface MessageTemplateClient
"templateValues",
"python"
);

@@clientName(Azure.Communication.MessagesService.NotificationMessagesSendRequestBody.body,
"notificationContent",
"csharp,java"
);
14 changes: 5 additions & 9 deletions specification/communication/Communication.Messages/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ interface NotificationMessagesOperations {
@doc("Sends a notification message from Business to User.")
send is Operations.ResourceCollectionAction<
Notifications,
BodyParameter<NotificationContent>,
NotificationMessagesSendRequestBody,
AcceptedResponse & SendMessageResult
>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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"
}
}
}
4 changes: 2 additions & 2 deletions specification/riskiq/Easm/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface Assets {
@updatesResource(AssetResource)
@post
updateAssets is Foundations.Operation<
AssetsUpdateParameter & AssetUpdateData,
AssetsUpdateParameter & BodyParameter<AssetUpdateData>,
Task
>;
@doc("Retrieve an asset by assetId.")
Expand Down Expand Up @@ -242,7 +242,7 @@ interface SavedFilters {
@put
createOrReplaceSavedFilter is Foundations.ResourceOperation<
SavedFilter,
SavedFilterData,
BodyParameter<SavedFilterData>,
SavedFilter
>;
@doc("Delete a saved filter with a given filterName.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/AssetUpdateData"
Expand Down Expand Up @@ -1102,6 +1103,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/SavedFilterData"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/AssetUpdateData"
Expand Down Expand Up @@ -1604,6 +1605,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/SavedFilterData"
Expand Down

0 comments on commit ad84205

Please sign in to comment.