Skip to content

--make-paths-enum generate enum with another paths #950

Closed
@Semigradsky

Description

@Semigradsky

For example, it generates

export interface paths {
  '/download/{p1}': {
    // ...
  },
}

export enum ApiPaths {
  getDownload: '/download/:p1',
}

So I can't choose type:

type X = paths[ApiPaths.getDownload] // error

As I see, that is why paths in export interface paths { and export enum ApiPaths { are different:
https://github.com/drwpow/openapi-typescript/blob/a4e05fa005277ea1e42eb191921aae5d9f51293a/src/transform/paths.ts#L127-L128

@berzi hi! Could you answer if this change is needed?

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