How to disable @odata.type Field in serialized Object #3011
Unanswered
TobiasForbrich
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hello @TobiasForbrich. Is the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi community,
sorry for my bad english and probably stupid question: I am using the new OData Client for .NET 8.0 and have following issue:
I have a given OData Rest API Service with a Object "ProductionOrder" which has several Enum-Properties.
When I create a POST Message using the DataServiceContext Client-Classes generated by the ConnectedServices Visual Studio Plug-In, the serialized JSON-Body contains extra "@odata.type" fields for each Enum-Member of the ProductionOrder. Here a simplified example with the enum-Property "Status"
{ "@odata.type": "#MESOGanttplan.Api.Module.BusinessObjects.ProductionOrder", "ProductionOrderId": "test2", "Status@odata.type": "#MESOGanttplan.Model.Enums.ProductionOrderStatusEnum", "Status": "NotPlanned" }
The Backend OData Service I use can't handle this extra properties and fails.
If I manually remove the "Status@odata.type" property, like following, the request succeeds.
{ "@odata.type": "#MESOGanttplan.Api.Module.BusinessObjects.ProductionOrder", "ProductionOrderId": "test2", "Status": "NotPlanned" }
Is there any way to avoid the extra Json-Field for the enum-Propertytypes?
A am happy for any advice!
regards,
Tobias
Beta Was this translation helpful? Give feedback.
All reactions