microsoftgraph / msgraph-metadata

Microsoft Graph metadata captured and used for generating client library code files.
https://graph.microsoft.com
MIT License
105 stars 31 forks source link

Set-MgApplicationLogo requires Content-Type to be image/* #148

Open peombwa opened 2 years ago

peombwa commented 2 years ago

Set-MgApplicationLogo fails with Content-Type was application/octet-stream. Image Content-Type header should be one of the following: [image/bmp, image/emf, image/wmf, image/jpg, image/jpeg, image/gif, image/ico, image/png, image/exif, image/tif, image/tiff, image/*, images/*]..

The OpenAPI document currently describes the content-type as application/octet-stream. AutoREST.PowerShell expects the right content-type to be explicitly described in the OpenAPI document.

Repro Steps

Set-MgApplicationLogo -ApplicationId $app.Id -InFile "C:\PATH_TO_LOGO\Logo.png"

Related to microsoftgraph/msgraph-sdk-powershell#1028, microsoftgraph/msgraph-sdk-powershell#935

ddyett commented 2 years ago

@peombwa did we have an openapi issue on this?

peombwa commented 2 years ago

@ddyett, the issue is already in the metadata repro.

We will need an XSLT transform that annotates the logo property of application entityType with a MediaType annotation of image/* for this to work.

peombwa commented 1 year ago

The annotation should also be applied to organization/{organization-id}/branding/localizations/{localization-id}/backgroundImage.