OData / OData/AspNetCoreOData

Invalid body result in null ODataActionPararmeters

Open
#741 4 comments 1 reaction 1 assignee View on GitHub

@xuzhg is already working on this.

Since Nov 16, 2022.

bug
Dominant language
C#
Stars
505
Forks
186
PR merge metrics
No merged PRs in 30d

Description

Assemblies affected
ASP.NET Core OData 8.x

Describe the bug
When calling an action (and presumably a function as well) that accepts parameters with a body that is not valid json, is empty or has the wrong content type will not result in a 400 Bad Request or 415 Media Type Not Support. Instead the method on the controller will receive a null ODataActionParameters.

Reproduce steps
Using the routing sample, call Customer(1)/BoundAction with an empty content or invalid json body.

Request/Response

BoundAction of Customers with key 1 : null

Expected behavior
400 Bad Request

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.