From cd8a827e1781a2d028180a3d9e666f4225ae5d01 Mon Sep 17 00:00:00 2001 From: Duncan Beevers Date: Mon, 9 May 2022 18:15:47 -0700 Subject: [PATCH] fix: export enum of operation paths Closes #911 --- src/transform/paths.ts | 2 +- test/bin/expected/paths-enum.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transform/paths.ts b/src/transform/paths.ts index 03201865a..00a2ce4f9 100644 --- a/src/transform/paths.ts +++ b/src/transform/paths.ts @@ -101,7 +101,7 @@ export function transformPathsObj(paths: Record, options * Generate an Enum with operation names as keys and the corresponding paths as values. */ export function makeApiPathsEnum(paths: Record): string { - let output = "enum ApiPaths {\n"; + let output = "export enum ApiPaths {\n"; for (const [url, pathItem] of Object.entries(paths)) { for (const [method, operation] of Object.entries(pathItem)) { diff --git a/test/bin/expected/paths-enum.ts b/test/bin/expected/paths-enum.ts index 73eb9fc74..b613340c7 100644 --- a/test/bin/expected/paths-enum.ts +++ b/test/bin/expected/paths-enum.ts @@ -489,7 +489,7 @@ export interface operations { export interface external {} -enum ApiPaths { +export enum ApiPaths { updatePet = "/pet", addPet = "/pet", findPetsByStatus = "/pet/findByStatus",