Skip to Content
2
Dec 11, 2022 at 06:02 PM

Serving Media Data: Content Type application/json dets data in @Core.IsMediaType field to null

250 Views Last edit Dec 11, 2022 at 06:10 PM 2 rev

Hello CAP Community,

it seems that the Media Handling works great for all kind of data formats like Word, Excel, PNG, JPEG, YAML and others. But it doesn't work correctly for JSON. When I create a new entry using the URL http://localhost:4004/$fiori-preview/AdminService/DocumentsWithDraft?sap-language=en#preview-app provided from my sample app bookshop-demo I see the following requests:

screenshot-2022-12-11-at-184428.png

As you can see the content is sent with the correct Content Type application/json. But in the following request where the current state of the entity is read the field content@odata.mediaContentType is returned as null:

screenshot-2022-12-11-at-184450.png

When a YAML file is uploaded you directly see that the field "Content" is filled. Here you see that the Content-Type is set:

screenshot-2022-12-11-at-184539.png

But in contrast to the JSON file also the value for content@odata.mediaContentType is filled:

screenshot-2022-12-11-at-184555.png

Looking forward for a correction.

Best Regards
Gregor