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

[Http] expose necessary api for multipart #3676

Merged

Conversation

msyyc
Copy link
Contributor

@msyyc msyyc commented Jun 27, 2024

TCGC needs these API exposed

Copy link
Member

@timotheeguerin timotheeguerin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain more why this needs to be exposed. There is a reason they are internal, the public info is via the http operation

@msyyc
Copy link
Contributor Author

msyyc commented Jul 1, 2024

Can you explain more why this needs to be exposed. There is a reason they are internal, the public info is via the http operation

Please see https://github.com/Azure/typespec-azure/pull/1090/files/223f68e13c989cfafd483f01034afeaeb2b59b66#r1660410950

@timotheeguerin timotheeguerin added this pull request to the merge queue Jul 8, 2024
Merged via the queue into microsoft:main with commit a38126c Jul 8, 2024
17 checks passed
msyyc added a commit to Azure/typespec-azure that referenced this pull request Jul 24, 2024
- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants