Hi @André Nobrega ,
If you don't set the value of PersonSpecified, its value is false by default.
You can click on the link about: JSON Media-Type Formatter.
▶Edit◀
I find it strange that I don't need to set the value of "IdSpecified", "FirstNameSpecified" or "LastNameSpecified".
Complex objects will always have their respective "isSpecified" property set to false.
✦As I mentioned earlier, even if you do not make any assignments, the default value of the bool type will be set to false.
✦Do you want to not set the default value -false for the bool type?In this case, you can use a nullable value type.
public bool? DetailsSpecified { get; set; }
However, if you do not manually assign the value this way, it will still set the default value to null.
Now I'm trying to add support for JSON input as well
✦Web API includes JsonMediaTypeFormatter class that handles JSON format.
✦Regarding the above mentioned link (JSON Media-Type Formatter):
JSON formatter can be configured in WebApiConfig class. You can customize JSON serialization using the JsonMediaTypeFormatter class.
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards,
YihuiSun