Azure / Azure/azure-functions-openapi-extension
Byte properties on classes are ignored in the definition.
- Dominant language
- C#
- Stars
- 388
- Forks
- 202
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the issue**
When adding a class that contains a property of type `Byte` the property is ignored.
**To Reproduce**
Steps to reproduce the behavior:
1. Create an HTTP azure function with a return value that is a class with a property of type `Byte`
2. Run the app and navigate to the swagger UI
3. Find the type
4. Notice the property is not present in the definition
Sample class:
```
public class TestResponse
{
public Byte TestData { get; set; }
}
```
Sample Attribute
```
[OpenApiResponseWithBody(statusCode: HttpStatusCode.OK, contentType: "application/json", bodyType: typeof(TestResponse))]
```
**Expected behavior**
The property should be present in the OpenAPI definition.
**Environment (please complete the following information, if applicable):**
- OS: Windows 10
- Browser: Edge
Contributor guide
Research direction
Start by reproducing the issue with the provided TestResponse class and OpenApiResponseWithBody attribute in an HTTP Azure Function, then inspect the schema generation path for Byte properties. The work is done when the generated Swagger/OpenAPI definition includes TestData with the expected byte-compatible schema.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, openapi
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100