Our ASP.NET Core app has an endpoint which reads the Request.Body
stream directly rather than using endpoint parameters and [FromBody]
.
[HttpPost("event")]
public Task PostEvent(string clientId)
{
_someService.HandleEvent(clientId, Request.Body);
}
This works great, but the Swagger UI doesn't provide a text box for the body content because it's not in the method signature.
Is there a way to easily get Swagger to provide a <textarea>
element for the body content?
I am currently trying this in Azure Functions and found this attribute for me: [RequestBodyType(typeof(TestModel), "testmodel")]
link here
Hopefully this will give you some hint to find something similar