-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Multipart] Support model format for
@multipartBody
(#1090)
- 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.
- Loading branch information
Showing
4 changed files
with
518 additions
and
26 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
.chronus/changes/multipart-implementation-2024-5-28-10-50-5.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
changeKind: feature | ||
packages: | ||
- "@azure-tools/typespec-client-generator-core" | ||
--- | ||
|
||
Support model format of `@multipartBody` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.