Azure / Azure/azure-functions-openapi-extension
OpenApiProperty default array unable to cast to string
- Dominant language
- C#
- Stars
- 388
- Forks
- 202
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the issue**
swagger or open api documentation document generation throws an error:
Unable to cast object of type 'System.Int32[]' to type 'System.String'
**To Reproduce**
Steps to reproduce the behavior:
1. add attribute
[OpenApiProperty(Default = new int[] { 2, 3 }, Description = "list", Deprecated = false)]
2. swagger.json or openapi.yaml generations fail
**Expected behavior**
documentation document is generated without issues
Contributor guide
Research direction
Start by reproducing swagger.json or openapi.yaml generation with the shown OpenApiProperty attribute and trace where the Int32[] default is converted during document generation. Done means the example generates documentation without the cast-to-String error, while preserving the default array value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100