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

[Feature Request] Add support for MediaType annotation #342

Closed
peombwa opened this issue Feb 18, 2023 · 0 comments · Fixed by #375
Closed

[Feature Request] Add support for MediaType annotation #342

peombwa opened this issue Feb 18, 2023 · 0 comments · Fixed by #375
Assignees
Milestone

Comments

@peombwa
Copy link
Contributor

peombwa commented Feb 18, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants