Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix body spread breaking change #29723

Merged
merged 10 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
}
}