Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IFormFile is not working with Swagger, but If i change to byte[] it is working #682

Open
logeshpalani33 opened this issue Jan 27, 2025 · 0 comments

Comments

@logeshpalani33
Copy link

logeshpalani33 commented Jan 27, 2025

Describe the issue
I can't use IFormFile in Swagger, we are using IFormFile in many places, so i just don't want to change into byte[]. can you suggest me some alternative configuration ways to fix this.

To Reproduce
Steps to reproduce the behavior:

public class PostRequestDto
{
    public Guid id { get; set; } = Guid.Empty;
    public string title { get; set; }
    public string description { get; set; }
    public IFormFile? image { get; set; }
    public string isActive { get; set; }
    public string createdBy { get; set; }
    public DateTime? createdTime { get; set; }
}

Expected behavior
Excepted to load the Swagger UI, it throws "Index out of range"

Image

Screenshots
If applicable, add screenshots to help explain your issue.

Environment (please complete the following information, if applicable):

  • OS: [e.g. Mac]
  • Browser Chrome, Safari]
  • Version [V3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant