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

Support File for multipart/form data in RLC #2258

Merged
merged 53 commits into from
Feb 23, 2024

Conversation

MaryGao
Copy link
Member

@MaryGao MaryGao commented Jan 29, 2024

fixes #2176 and #2196 and #2200

The pr would cover the followings:

  • Multipart/form-data support
    • Translate bytes to | string | Uint8Array | ReadableStream<Uint8Array> | NodeJS.ReadableStream | File
    • Export createFile, createFileFromStream and relevant options from @azure/core-rest-pipeline
    • Integrate cadl-ranch cases
  • Refactor media types code
  • Handle bytes according to content types

Please note below issues are NOT covered in this pr:

@MaryGao MaryGao changed the title Re-organize the test cases Support File for multipart/form data in RLC Jan 29, 2024
Copy link
Member

@joheredi joheredi left a comment

Choose a reason for hiding this comment

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

Looks good, the only question I have is around bytes generating string instead of uint8array

@MaryGao
Copy link
Member Author

MaryGao commented Feb 21, 2024

Looks good, the only question I have is around bytes generating string instead of uint8array

@joheredi The pr implementation is to have a white list to translate bytes to binary/file/string according to encode/content-type context. For unrecognized cases it would go to default logic as string not uint8array.

This would be debatable. First I would be more caring about the existence possibility of these unrecognized cases so I created issues to figure out them(#2278 and #2276); Secondly if the default type is uint8Array I am not sure the core logic is correct(https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-client-rest/src/sendRequest.ts#L145) and setting as string would require customers to handle encode and may work around from e2e side.

So I prefer to have string then to keep collecting the real cases. How do you think?

@MaryGao MaryGao force-pushed the form-data-type-fix branch 2 times, most recently from 8c96e33 to 759ca63 Compare February 21, 2024 08:32
@MaryGao
Copy link
Member Author

MaryGao commented Feb 23, 2024

@joheredi @qiaozha I plan to merge this pr and let me know if any further concern!

@MaryGao MaryGao merged commit 1503831 into Azure:main Feb 23, 2024
28 checks passed
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.

Handle bytes differently according to content type in RLC
4 participants