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

[Multipart] Support model format for @multipartBody #1090

Merged
merged 20 commits into from
Jul 24, 2024

Conversation

msyyc
Copy link
Member

@msyyc msyyc commented Jun 27, 2024

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;
  1. advanced model format
op upload(
  @header `content-type`: "multipart/form-data",
  @multipartBody body: {
    fullName: HttpPart<string>,
    headShots: HttpPart<bytes[]>
  }
): void;
  1. advanced array format
op upload(
  @header `content-type`: "multipart/form-data",
  @multipartBody body: [
    // single
    HttpPart<string, #{ name: "fullName" }>,
    HttpPart<bytes[], #{ name: "headShots" }>,
  ]
): void;

@azure-sdk
Copy link
Collaborator

azure-sdk commented Jun 27, 2024

All changed packages have been documented.

  • @azure-tools/typespec-client-generator-core
Show changes

@azure-tools/typespec-client-generator-core - feature ✏️

Support model format of @multipartBody

@azure-tools/typespec-client-generator-core - fix ✏️

have @clientName work for operation groups as well

@azure-tools/typespec-client-generator-core - feature ✏️

add xml usage and change enumvalue arg representation in generic decorators

@msyyc msyyc requested a review from chunyu3 July 1, 2024 06:57
@azure-sdk
Copy link
Collaborator

@msyyc msyyc changed the base branch from main to publish/hotfix/tcgc July 17, 2024 05:24
@tadelesh tadelesh deleted the branch release/july-2024 July 17, 2024 05:40
@tadelesh tadelesh closed this Jul 17, 2024
@tadelesh tadelesh reopened this Jul 17, 2024
@tadelesh tadelesh changed the base branch from publish/hotfix/tcgc to release/july-2024 July 17, 2024 05:43
@msyyc msyyc requested a review from tadelesh July 18, 2024 04:39
@msyyc msyyc merged commit a242706 into release/july-2024 Jul 24, 2024
20 of 22 checks passed
@msyyc msyyc deleted the multipart-implementation branch July 24, 2024 02:02
github-merge-queue bot pushed a commit that referenced this pull request Aug 5, 2024
…peration` (#1281)

supplement for PR #1090
- Support @multipartBody for `bodyParam` of `SdkHttpOperation`
- Only property of multipart body shall be added `multipartOptions` and
the property of base model shall have no `multipartOptions`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants