You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently TCGC only has boolean flag isMultipartFileInput, which is not enough to support some new features of multipart in Typespec. As first step, we shall design new TCGC API for multipart.
- fixes part of #960
- Pending on microsoft/typespec#3676
Context:
Typespec supports 3 kinds of format to define multipart:
1. common
```
op upload(
@Header `content-type`: "multipart/form-data",
@Body body: {
basic: string,
headShots: bytes[],
}
): void;
```
2. advanced model format
```
op upload(
@Header `content-type`: "multipart/form-data",
@multipartBody body: {
fullName: HttpPart<string>,
headShots: HttpPart<bytes[]>
}
): void;
```
3. advanced array format
```
op upload(
@Header `content-type`: "multipart/form-data",
@multipartBody body: [
// single
HttpPart<string, #{ name: "fullName" }>,
HttpPart<bytes[], #{ name: "headShots" }>,
]
): void;
```
- This PR is implementation for API design
#987, mainly for 1 and 2
format. Format 3 will be implemented in another PR.
After microsoft/typespec#3046, Typespec already supports complete multipart feature, and TCGC needs to adopt it.
Bug in Typespec
Feature
TCGC API design
TCGC Implementation
@multipartBody
#1090Cadl-Ranch Test
HttpPart
cadl-ranch#613The text was updated successfully, but these errors were encountered: