-
Notifications
You must be signed in to change notification settings - Fork 299
Closed
Labels
emitter:client:csharpIssue for the C# client emitter: @typespec/http-client-csharpIssue for the C# client emitter: @typespec/http-client-csharp
Description
Clear and concise description of the problem
This was found during investigation of #4208. We have two properties regarding request body media type in InputOperation
:
RequestBodyMediaType
: It's determined by the request body parameter type
RequestBodyMediaType: getBodyMediaType(method.operation.bodyParam?.type), - It's not used in MGC.
- In
autorest.csharp
, it's used byCmcRestClientBuilder
andRestClientBuilder
RequestMediaTypes
: it's determined by scanning the operation, which I think is more accurate
RequestMediaTypes: getRequestMediaTypes(method.operation), - It's not used in MGC either (probably MGC hasn't implement the various media type support?)
- In
autoest.csharp
: it's used byOperationMethodChainBuilder
when setting the request Content-Type header: https://github.com/Azure/autorest.csharp/blob/a19bafb7ff7418930deb75b1df40ccbf55825228/src/AutoRest.CSharp/LowLevel/Output/OperationMethodChainBuilder.cs#L557 - it's used by
ConvenienceMethod
when determine how to serialize the input body: https://github.com/Azure/autorest.csharp/blob/a19bafb7ff7418930deb75b1df40ccbf55825228/src/AutoRest.CSharp/LowLevel/Output/ConvenienceMethod.cs#L36
When we implement MGC regarding media types, we should use RequestMediaTypes
for all kinds of SDKs (DPG, MPG, HLC,...).
Checklist
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
emitter:client:csharpIssue for the C# client emitter: @typespec/http-client-csharpIssue for the C# client emitter: @typespec/http-client-csharp