Skip to content

How to display Enum values in generated OpenAPI Document as 'string' instead of 'numbers'? #555

Open
@spmanjunath

Description

@spmanjunath

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
image

**Environment

  • Azure Function Isolated
  • .Net 7.0, C#
  • Azure Function Host 4.0
  • Microsoft.Azure.Functions.Worker.Extensions.OpenApi (1.5.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions