Appendix

Errors

Error message
Possible reason

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

  • IActionResult is used when multiple return types are possible, otherwise ActionResult<T> can be used. The type property of ProducesResponseTypeAttribute can be excluded for ActionResult<T>.

  • OData functions can only be HttpGet, OData actions can only be HttpPost.

  • By protocol specification enums are 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 From parameter bindings are required, otherwise Swashbuckle will describe them as query parameters by default. Code comments of parameters decorated with FromForm do not show up (#2519).

Last updated

Was this helpful?