Skip to content

Support enum propertyNames #2196

Open
@martinboue

Description

@martinboue

Add support for dictionaries as propertyNames.

Input

components:
  schema:
    MyObject:
      type: object
      propertyNames:
        type: string
        enum:
          - foo
          - bar
      additionalProperties:
        type: string

Actual output:

export interface MyObject {
  [key: string]: string
}

Expected output:

export interface MyObject {
  [key: 'foo' | 'bar']: string
}

or const/enum equivalent depending on enumGenerationType config.

Context

Orval version: 7.10.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededopenapi_31OpenAPI 3.1 related issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions