ardalis / ApiEndpoints

A project for supporting API Endpoints in ASP.NET Core web applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consider FromMultiSourceAttribute Necessity and Document It If It Helps

ardalis opened this issue · comments

Version 3.1 sometimes had issues with request types being pulled from multiple locations (route, query, body).

Nick Chapsas shows a solution to this problem here. The MultiSourceAttribute.

I'm not sure if the problem still exists in v4, but if it does we should show how to use this attribute to address it.

References:

As per my comment here: #161 (comment) this was something I tried but it doesn't play well with Swagger (or Redoc) nor does it work if you have multiple fields that come from the body. You will still need to create a class representing the body details like I mention, in which case my solution continues to work fine and doesn't need the attribute.

Good to know, thanks, Allann.