on ‎2022 Dec 11 6:02 PM
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:

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:

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

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

Looking forward for a correction.
Best Regards
Gregor
Request clarification before answering.
@gregorw We added support of streaming with 'application/json' as content-type. The data field should be modelled as cds.LargeBinary. The feature to be provided with the next release of @sap/cds.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.