Azure / Azure/azure-functions-openapi-extension
How to display Enum values in generated OpenAPI Document as 'string' instead of 'numbers'?
- Dominant language
- C#
- Stars
- 388
- Forks
- 202
- PR merge metrics
- No merged PRs in 30d
Description
I have defined a Transport enum as below, i want the Open API Specification to show the enum values as string instead of numeric.
```
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum BusinessFunction
{
[EnumMember(Value = "Liner")]
Liner = 100000000,
[EnumMember(Value = "Trucking")]
Trucking = 100000001
}
```
**Current behaviour**

**Environment
- Azure Function Isolated
- .Net 7.0, C#
- Azure Function Host 4.0
- Microsoft.Azure.Functions.Worker.Extensions.OpenApi (1.5.1)
Contributor guide
Research direction
Reproduce the generated document in an Azure Functions isolated app using .NET 7, Azure Functions Host 4.0, and Microsoft.Azure.Functions.Worker.Extensions.OpenApi 1.5.1 with the shown enum. Inspect the generated schema and determine whether the enum is represented as string values rather than numeric values; done when the OpenAPI document reflects the requested representation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100