The converter should use the MediaType annotation in a CSDL to compute the media type of an operation. See https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#core-vocabulary.
API producers should then be able to use the annotation to specify which mediaType is required when calling their API. We currently assume the more generic application/octet-stream media type, which is not supported by some APIs:
|
if (operation.ReturnType.AsPrimitive()?.PrimitiveKind() == EdmPrimitiveTypeKind.Stream) |
|
{ |
|
// Responses of types Edm.Stream should be application/octet-stream |
|
mediaType = Constants.ApplicationOctetStreamMediaType; |
|
} |
Related to microsoftgraph/msgraph-metadata#148.
The converter should use the MediaType annotation in a CSDL to compute the media type of an operation. See https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#core-vocabulary.
API producers should then be able to use the annotation to specify which mediaType is required when calling their API. We currently assume the more generic
application/octet-streammedia type, which is not supported by some APIs:OpenAPI.NET.OData/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiResponseGenerator.cs
Lines 270 to 274 in b9e2a2a
Related to microsoftgraph/msgraph-metadata#148.