Azure / Azure/azure-functions-openapi-extension

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

Open
#682 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
388
Forks
202
PR merge metrics
No merged PRs in 30d

Description

**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]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.