Skip convenience method generation for multipart/mixed requests#10967
Merged
jorgerangel-msft merged 5 commits intoJun 11, 2026
Conversation
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Disable generating convenience methods for multipart/mixed requests
Skip convenience method generation for multipart/mixed requests
Jun 11, 2026
commit: |
jorgerangel-msft
left a comment
Contributor
There was a problem hiding this comment.
@copilot ensure we add proper unit tests for our changes
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
jorgerangel-msft
left a comment
Contributor
There was a problem hiding this comment.
@copilot ensure we are regenerating all test libraries
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Contributor
Author
Added emitter unit tests in |
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Contributor
Author
Ran |
jorgerangel-msft
approved these changes
Jun 11, 2026
JoshLove-msft
approved these changes
Jun 11, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The C# emitter does not support
multipart/mixedrequests, yet since the addition ofmultipart/form-datasupport it would emit an incorrect convenience method for them. This disables convenience method generation for multipart content types other thanmultipart/form-dataand surfaces a diagnostic instead.The detection lives in the emitter so the generator simply honors the resulting
generateConvenienceMethodflag.Changes
operation-converter.ts: InfromSdkServiceMethodOperation, when an operation uses amultipart/*content type other thanmultipart/form-data,generateConvenienceMethodis set tofalse(protocol methods still emitted) and a warning diagnostic is reported. A smallisUnsupportedMultiparthelper inspects the request media types.lib.ts: Added theunsupported-multipart-convenience-methodwarning diagnostic.operation-converter.test.ts—multipart/mixedturns off convenience method generation and emits the warning, whilemultipart/form-datakeeps convenience methods with no diagnostic.No existing test specs use
multipart/mixed, so generated library output is unchanged.