Skip to content

Implement OpenAPI support for intEnum #1667

@ericxinzhang

Description

@ericxinzhang

OpenAPI spec allows integer enums, e.g.

Sampling:
  type: integer
  enum: [1, 5, 10]

I created an intEnum type in my smithy model as following:

intEnum Sampling {
    ONE_PERCENT = 1
    FIVE_PERCENT = 5
    TEN_PERCENT = 10
}

I thought it would generate related enum in the OpenAPI spec but what I get is:

  "sampling": {
      "type": "number"
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions