-
Notifications
You must be signed in to change notification settings - Fork 103
Open
Description
I'm trying to insert an Entity to the odata sample TripPinRESTierService. Got a special key that allows me to make a modification, send a request
POST https://services.odata.org/TripPinRESTierService/(S(<key>))/People
headers:
Content-Type:application/json
body:
{
"UserName": "teresa",
"FirstName" : "Teresa",
"LastName" : "Gilbert"
}
And have a response 201 Created
But when I add a Gender (enum) value to the body:
POST https://services.odata.org/TripPinRESTierService/(S(<key>))/People
headers:
Content-Type:application/json
body:
{
"UserName": "teresa",
"FirstName" : "Teresa",
"LastName" : "Gilbert",
"Gender" : "Female"
}
I have a 500 Internal Server Error:
{
"error": {
"code": "",
"message": "Gender"
}
}
The property description in the odata $metadata:
<Property Name="Gender" Type="Trippin.PersonGender" Nullable="false"/>
...
<EnumType Name="PersonGender">
<Member Name="Male" Value="0" />
<Member Name="Female" Value="1" />
<Member Name="Unknown" Value="2" />
</EnumType>
I also tried with setting just int values to the body, or Trippin.PersonGender'Male' but have the same result. The example for the odata.org says I just need to set a simple string value: https://www.odata.org/getting-started/basic-tutorial/#create
It works well when I'm doing same operation for (http://services.odata.org/V4/(S())/TripPinServiceRW)
What am I doing wrong?
Metadata
Metadata
Assignees
Labels
No labels