Closed TonyValenti closed 3 years ago
I get your point and I agree with you. I will likely change this in next major version.
Those definitions classes are auto generated from swagger spec. So they purely serves as JSON serialization/deserialization purpose. So they probably don't need those benefits properties have over fields.
The default ASP.NET JSON model binder doesn't work with fields. The following produces null
values in the message variable.
public async Task<IActionResult> Receive([FromBody] InstantMessageEvent message)
I pasted the WebHook JSON "as classes" which creates properties and replaced InstantMessageEvent
with the custom class and the model binder works.
@JeffEmery Thanks for the information and it is very useful.
Release 5.0.0-beta4
It seems that the data in RingCentral is all stored as fields. In .NET, it is standard practice to use properties instead.
For example:
becomes: