Support for POST endpoints with text/plain inputs?
Hi,
I see that some work for text outputs was done for https://github.com/fsprojects/SwaggerProvider/issues/268, but I wonder if text inputs are supported or have similar issues?
As an example, if I have an ASP.Net Core minimal api of this sort:
app.MapPost("/weatherforecast", ([FromBody] string body) =>
{
return "Wet";
}).Accepts<string>("text/plain");
Then the generated schema is like this
"requestBody": {
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
},
"required": true
},
And the type provider gives errors like
The type provider 'SwaggerProvider.OpenApiClientTypeProvider' reported an error: Operation '' does not contain supported media types ["text/plain"]
So is this something that needs more work in the provider to support?
Thanks.
What version of TP do you use? Would you like to contribute failing test case for this scenario?
I had the same error using both the latest release version and the version 3 preview version.
Would you like to contribute failing test case for this scenario?
The change in https://github.com/fsprojects/SwaggerProvider/pull/276 causes this error locally
Actually that's also a repro for https://github.com/fsprojects/SwaggerProvider/issues/274 so I'll see if I can do something with that.
Fixed in https://www.nuget.org/packages/SwaggerProvider/3.0.0-beta02