azure-functions-openapi-extension
azure-functions-openapi-extension copied to clipboard
Enums values are modified inconsistently, when enum is used as a type constraint for a parameter in path
Describe the issue Enums values are modified inconsistently, when enum is used as a type constraint for a parameter in path.
To Reproduce Steps to reproduce the behavior:
- Set up an enum with JsonConverterAttribute and decorate members with EnumMemberAttribute as shown in the screen shot 1.
- Set up an endpoint, where the enum we set up before is used as OpenApiParameter in ParameterLocation.Path. See screen shot 2.
- Generate the openapi document. The tooling as attempted and failed to convert the enum values to camelCase.
Expected behavior Enum shows up in the document as defined in code. The tooling does not enforce the produces document to be valid in other places either (for example, you can have Required = false for ParameterLocation.Path and invalid document is generated),
Screenshots
1: Setting the troublesome enum up for testing:

2: Setting up the endpoint:

3: The casing of enum values are altered in an arbitrary manner:

Environment (please complete the following information, if applicable):
- Openapi verison 3.0.1
- Microsoft.Azure.WebJobs.Extensions.OpenApi.Core 1.3.0
- Microsoft.Azure.WebJobs.Extensions.OpenApi 1.3.0
- Microsoft.OpenApi 1.3.1
- Local windows 11 dev environment, func --version: 4.0.4544
Additional context When the troublesome enum is used as a property in a request body, the enum values are displayed on the document as expected:
