You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an API action that returns a PhysicalFileResponse. But no matter what I do I cannot get the output swagger.json to contain the correct definition.
As I understand it there should be a type of "file" and something to do with "byte" in there, but all I get is:
...consumes:[],produces[],...
This means when I try to generate a Client using NSwag it creates code that either returns nothing (or if I use [Produces(typeof(PhysicalFileResponse))] then it does not handle the response as a file.
Am I doing something wrong or is this a missing feature?
The text was updated successfully, but these errors were encountered:
In this scenario, it's difficult for Swashbuckle to do the right thing because ASP.NET Core's built-in metatdata provider - ApiExplorer doesn't provide enough information.
The good news is that someone has already posted an issue to the Mvc repo for this. It's well worth a read because the thread includes a decent workaround that you can use:
I have an API action that returns a PhysicalFileResponse. But no matter what I do I cannot get the output swagger.json to contain the correct definition.
As I understand it there should be a type of "file" and something to do with "byte" in there, but all I get is:
...consumes:[],produces[],...
This means when I try to generate a Client using NSwag it creates code that either returns nothing (or if I use [Produces(typeof(PhysicalFileResponse))] then it does not handle the response as a file.
Am I doing something wrong or is this a missing feature?
The text was updated successfully, but these errors were encountered: