Skip to content

[Feature Request] Add support for MediaType annotation  #342

@peombwa

Description

@peombwa

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions