Skip to content

Commit 79026ff

Browse files
Bump core from e0a9683 to 92b7a73 (#2397)
Bumps [core](https://github.com/microsoft/typespec) from `e0a9683` to `92b7a73`. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/microsoft/typespec/commit/92b7a73c10a6590f5d7be8c906342b698a143497"><code>92b7a73</code></a> Openapi3 split types (<a href="https://redirect.github.com/microsoft/typespec/issues/6491">#6491</a>)</li> <li><a href="https://github.com/microsoft/typespec/commit/76a3459f4e1502dedbbadf949589d3ad28f93b24"><code>76a3459</code></a> Reseve additional keywords (<a href="https://redirect.github.com/microsoft/typespec/issues/6494">#6494</a>)</li> <li><a href="https://github.com/microsoft/typespec/commit/5eafeb128291d04490ba2335cfe0fd12ae4a21ee"><code>5eafeb1</code></a> Deprecate implicit multipart (<a href="https://redirect.github.com/microsoft/typespec/issues/6464">#6464</a>)</li> <li><a href="https://github.com/microsoft/typespec/commit/30adae5c5020f6ebdcfc4bc76ed8476bd8c7abb0"><code>30adae5</code></a> Link to TypeSpec homepage in emitters (<a href="https://redirect.github.com/microsoft/typespec/issues/6490">#6490</a>)</li> <li><a href="https://github.com/microsoft/typespec/commit/46059311f7fc33843b0b9733df1b10bd4c9efd1e"><code>4605931</code></a> openapi3 - support <a href="https://github.com/encode"><code>@​encode</code></a> for <a href="https://github.com/query"><code>@​query</code></a> parameters (<a href="https://redirect.github.com/microsoft/typespec/issues/6473">#6473</a>)</li> <li>See full diff in <a href="https://github.com/microsoft/typespec/compare/e0a9683ae89168b56430df6da753403cd3657e64...92b7a73c10a6590f5d7be8c906342b698a143497">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Timothee Guerin <[email protected]>
1 parent 64c428e commit 79026ff

File tree

8 files changed

+28
-92
lines changed

8 files changed

+28
-92
lines changed

packages/typespec-autorest-canonical/test/multipart.test.ts

-56
This file was deleted.

packages/typespec-autorest/test/multipart.test.ts

+5
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ describe("legacy implicit form", () => {
104104
it("part of type `bytes` produce `type: file`", async () => {
105105
const res = await openApiFor(
106106
`
107+
#suppress "deprecated" "For test"
107108
op upload(@header contentType: "multipart/form-data", profileImage: bytes): void;
108109
`,
109110
);
@@ -121,6 +122,7 @@ describe("legacy implicit form", () => {
121122
it("set part doc", async () => {
122123
const res = await openApiFor(
123124
`
125+
#suppress "deprecated" "For test"
124126
op upload(@header contentType: "multipart/form-data", @doc("Part doc") profileImage: bytes): void;
125127
`,
126128
);
@@ -139,6 +141,7 @@ describe("legacy implicit form", () => {
139141
it("part of type `bytes[]` produce `type: array, items: { type: string, format: binary }`", async () => {
140142
const res = await openApiFor(
141143
`
144+
#suppress "deprecated" "For test"
142145
op upload(@header contentType: "multipart/form-data", profileImage: bytes[]): void;
143146
`,
144147
);
@@ -160,6 +163,7 @@ describe("legacy implicit form", () => {
160163
it("part of type `string` produce `type: string`", async () => {
161164
const res = await openApiFor(
162165
`
166+
#suppress "deprecated" "For test"
163167
op upload(@header contentType: "multipart/form-data", name: string): void;
164168
`,
165169
);
@@ -179,6 +183,7 @@ describe("legacy implicit form", () => {
179183
const res = await openApiFor(
180184
`
181185
#suppress "@azure-tools/typespec-autorest/unsupported-multipart-type" "For test"
186+
#suppress "deprecated" "For test"
182187
op upload(@header contentType: "multipart/form-data", address: {city: string, street: string}): void;
183188
`,
184189
);

packages/typespec-autorest/test/openapi-output.test.ts

-34
Original file line numberDiff line numberDiff line change
@@ -1032,37 +1032,3 @@ describe("identifiers decorator", () => {
10321032
]);
10331033
});
10341034
});
1035-
1036-
describe("typespec-autorest: multipart formData", () => {
1037-
it("expands model into formData parameters", async () => {
1038-
const oapi = await openApiFor(`
1039-
@service
1040-
namespace Widget;
1041-
1042-
@doc("A widget.")
1043-
model Widget {
1044-
@key("widgetName")
1045-
name: string;
1046-
displayName: string;
1047-
description: string;
1048-
color: string;
1049-
}
1050-
1051-
model WidgetForm is Widget {
1052-
@header("content-type")
1053-
contentType: "multipart/form-data";
1054-
}
1055-
1056-
@route("/widgets")
1057-
interface Widgets {
1058-
@route(":upload")
1059-
@post
1060-
upload(...WidgetForm): Widget;
1061-
}
1062-
`);
1063-
for (const val of ["Widget.color", "Widget.description", "Widget.displayName", "Widget.name"]) {
1064-
const param = oapi.parameters[val];
1065-
strictEqual(param["in"], "formData");
1066-
}
1067-
});
1068-
});

packages/typespec-azure-core/test/rules/byos.test.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ describe("typespec-azure-core: byos rule", () => {
2626

2727
it("emit warning if content type is multipart/form-data (explicit)", async () => {
2828
await tester
29-
.expect(`op uploadFile(data: bytes, @header contentType: "multipart/form-data"): void;`)
29+
.expect(
30+
`op uploadFile(@multipartBody data: {data: HttpPart<bytes>}, @header contentType: "multipart/form-data"): void;`,
31+
)
3032
.toEmitDiagnostics({
3133
code: "@azure-tools/typespec-azure-core/byos",
3234
});

packages/typespec-client-generator-core/test/methods/spread.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ it("formdata model without body decorator in spread model", async () => {
364364
document: bytes;
365365
}
366366
alias Intersected = DocumentTranslateContent & {};
367+
#suppress "deprecated" "For test"
367368
op test(...Intersected): void;
368369
`);
369370
const method = getServiceMethodOfClient(runner.context.sdkPackage);

packages/typespec-client-generator-core/test/public-utils/get-http-operation-parameter.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ it("multipart case", async () => {
284284
await runner.compileWithBuiltInService(`
285285
@route("upload/{name}")
286286
@post
287+
#suppress "deprecated" "For test"
287288
op uploadFile(
288289
@path name: string,
289290
@header contentType: "multipart/form-data",

packages/typespec-client-generator-core/test/types/multipart.test.ts

+17
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ it("multipart form basic", async function () {
3030
profileImage: bytes;
3131
}
3232
33+
#suppress "deprecated" "For test"
3334
op basic(@header contentType: "multipart/form-data", @body body: MultiPartRequest): NoContentResponse;
3435
`);
3536

@@ -62,7 +63,9 @@ it("multipart conflicting model usage", async function () {
6263
profileImage: bytes;
6364
}
6465
66+
#suppress "deprecated" "For test"
6567
@put op jsonUse(@body body: MultiPartRequest): NoContentResponse;
68+
#suppress "deprecated" "For test"
6669
@post op multipartUse(@header contentType: "multipart/form-data", @body body: MultiPartRequest): NoContentResponse;
6770
`,
6871
);
@@ -84,9 +87,11 @@ it("multipart conflicting model usage for only multipart operations", async func
8487
8588
@post
8689
@route("/basic1")
90+
#suppress "deprecated" "For test"
8791
op basic1(@header contentType: "multipart/form-data", @body body: MultiPartRequest): NoContentResponse;
8892
@post
8993
@route("/basic2")
94+
#suppress "deprecated" "For test"
9095
op basic2(@header contentType: "multipart/form-data", @body body: MultiPartRequest): NoContentResponse;
9196
`,
9297
);
@@ -117,9 +122,11 @@ it("multipart conflicting model usage for mixed operations", async function () {
117122
118123
@post
119124
@route("/basic1")
125+
#suppress "deprecated" "For test"
120126
op basic1(@body body: RegularRequest): NoContentResponse;
121127
@post
122128
@route("/basic2")
129+
#suppress "deprecated" "For test"
123130
op basic2(@header contentType: "multipart/form-data", @body body: MultiPartRequest): NoContentResponse;
124131
`,
125132
);
@@ -145,7 +152,9 @@ it("multipart resolving conflicting model usage with spread", async function ()
145152
...B
146153
}
147154
155+
#suppress "deprecated" "For test"
148156
@put op multipartOperation(@header contentType: "multipart/form-data", ...A): void;
157+
#suppress "deprecated" "For test"
149158
@post op normalOperation(...B): void;
150159
`,
151160
);
@@ -188,6 +197,7 @@ it("multipart with non-formdata model property", async function () {
188197
address: Address;
189198
}
190199
200+
#suppress "deprecated" "For test"
191201
@put op multipartOne(@header contentType: "multipart/form-data", @body body: AddressFirstAppearance): void;
192202
`,
193203
);
@@ -202,6 +212,7 @@ it("multipart with list of bytes", async function () {
202212
pictures: bytes[];
203213
}
204214
215+
#suppress "deprecated" "For test"
205216
@put op multipartOp(@header contentType: "multipart/form-data", @body body: PictureWrapper): void;
206217
`,
207218
);
@@ -227,6 +238,7 @@ it("multipart with encoding bytes raises error", async function () {
227238
pictures: bytes;
228239
}
229240
241+
#suppress "deprecated" "For test"
230242
@put op multipartOp(@header contentType: "multipart/form-data", @body body: EncodedBytesMFD): void;
231243
`,
232244
);
@@ -247,6 +259,7 @@ it("multipart with reused error model", async function () {
247259
errorCode: string;
248260
}
249261
262+
#suppress "deprecated" "For test"
250263
@put op multipartOp(@header contentType: "multipart/form-data", @body body: PictureWrapper): void | ErrorResponse;
251264
@post op normalOp(): void | ErrorResponse;
252265
`,
@@ -284,6 +297,7 @@ it("expands model into formData parameters", async function () {
284297
interface Widgets {
285298
@route(":upload")
286299
@post
300+
#suppress "deprecated" "For test"
287301
upload(...WidgetForm): Widget;
288302
}
289303
`);
@@ -340,6 +354,7 @@ it("usage doesn't apply to properties of a form data", async function () {
340354
}
341355
342356
@post
357+
#suppress "deprecated" "For test"
343358
op upload(@header contentType: "multipart/form-data", @body body: MultiPartRequest): void;
344359
`);
345360
const models = runner.context.sdkPackage.models;
@@ -363,6 +378,7 @@ it("Json[] and bytes[] in multipart/form-data", async function () {
363378
city: string;
364379
}
365380
@post
381+
#suppress "deprecated" "For test"
366382
op upload(@header contentType: "multipart/form-data", @body body: MultiPartRequest): void;
367383
`);
368384
const models = runner.context.sdkPackage.models;
@@ -802,6 +818,7 @@ it("multipart in client customization", async () => {
802818
profileImage: bytes;
803819
}
804820
821+
#suppress "deprecated" "For test"
805822
@post op multipartUse(@header contentType: "multipart/form-data", @body body: MultiPartRequest): NoContentResponse;
806823
`,
807824
`

0 commit comments

Comments
 (0)