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

'@odata.type' property missing but required in FileAttachment and ItemAttachment #104

Open
bamncan opened this issue Oct 31, 2019 · 2 comments
Labels
ADO to GitHub automation label Issue caused by core project dependency modules or library

Comments

@bamncan
Copy link

bamncan commented Oct 31, 2019

Both FileAttachment and ItemAttachment require the @odata.type property in order to be accepted by the API when using such commands as Add Attachment. However, this isn't in the typings for either type.

A 422: Unprocessable Entity error with message Cannot process input of abstract type 'Microsoft.OutlookServices.Attachment' occurs when the attachment does not have this property.

For FileAttachment it should use: '@odata.type': '#microsoft.graph.fileAttachment'
For ItemAttachment it should use: '@odata.type': '#microsoft.graph.itemAttachment'

AB#7044

@ghost ghost added the ToTriage label Oct 31, 2019
@ghost ghost added this to Issues to triage in Graph SDK - Triage Oct 31, 2019
@MIchaelMainer
Copy link
Contributor

@krototype We'll need to update the generator to insert the odata.type and a comment to hint what the value should be.

https://github.com/microsoftgraph/MSGraph-SDK-Code-Generator/blob/dev/Templates/TypeScript/src/entity_types.ts.tt#L71

@MIchaelMainer MIchaelMainer removed this from Issues to triage in Graph SDK - Triage Jan 16, 2020
@MIchaelMainer
Copy link
Contributor

Until this is address in the generator, you'll need to set this property on the FileAttachment object.

We will need to address this for all types that descend from abstract base classes. Hopefully this information is captured in ODCM model for Typescript.

@ddyett ddyett added the ADO to GitHub automation label Issue caused by core project dependency modules or library label Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADO to GitHub automation label Issue caused by core project dependency modules or library
Projects
None yet
Development

No branches or pull requests

3 participants