cancel
Showing results for 
Search instead for 
Did you mean: 

Optional parameter in actions with post in odata v4

ravi_rajput
Participant
0 Kudos

Hi All,

In the oData v4, I have around 10 parameters, I need to make some of them optional.

If its possible to make the parameter optional, please help with some sample code for the same.

Accepted Solutions (0)

Answers (1)

Answers (1)

evanireland
Advisor
Advisor

OData Action Parameter is Nullable="true" by default. Suppose you have 2 parameters "A" and "B" and "B" is nullable.

Then in POST request body, either omit "B":

{ "A": 123 }

or provide a null value for "B":

{ "A": 123, "B": null }