You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by TobiasForbrich July 1, 2024
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"
The Backend OData Service I use can't handle this extra properties and fails.
If I manually remove the "[email protected]" property, like following, the request succeeds.
I tested this and confirmed that OData client includes @odata.type property annotations for both declared and dynamic enum properties. This is odd behaviour because we don't do the same for other declared properties.
It'd probably be a breaking change to rectify it in a minor version but we can consider it for the next major release
Discussed in #3011
Originally posted by TobiasForbrich July 1, 2024
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", "[email protected]": "#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 "[email protected]" 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
The text was updated successfully, but these errors were encountered: