Appendix
Errors
ODataException: Invalid JSON. An unexpected comma was found in scope 'Object'. A comma is only valid between properties of an object or between elements of an array.
A comma appended to the last property of a JSON formatted request body.
General developer notes
OData
IActionResultis used when multiple return types are possible, otherwiseActionResult<T>can be used. The type property ofProducesResponseTypeAttributecan be excluded forActionResult<T>.OData functions can only be
HttpGet, OData actions can only beHttpPost.By protocol specification
enumsare serialized using the enum member's string, not its value.Routing conventions (only partly applicable for AspNetCore.OData v.8).
$ref is not supported.
Reasonably accurate OData examples.
Explicit
Fromparameter bindings are required, otherwise Swashbuckle will describe them as query parameters by default. Code comments of parameters decorated withFromFormdo not show up (#2519).
Last updated
Was this helpful?