From 7ed6ba4f22097ceaf9c6ca86648e5e84ebffaa25 Mon Sep 17 00:00:00 2001 From: Arthur Rossi Date: Wed, 24 May 2023 15:13:01 -0300 Subject: [PATCH] Openapi-framework: Solving backslahses problems when on windows This commit solves the problem with windows file system when generating the swagger file with openapi-framework. With this commit the swagger is now generating the docs with ('/') instead of the ('\'). --- packages/openapi-framework/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/openapi-framework/index.ts b/packages/openapi-framework/index.ts index ab53a186..514500bb 100644 --- a/packages/openapi-framework/index.ts +++ b/packages/openapi-framework/index.ts @@ -237,7 +237,7 @@ export default class OpenAPIFramework implements IOpenAPIFramework { // at top-level const imported = await import(`file://${fsRoutesItem.path}`); return { - path: fsRoutesItem.route, + path: fsRoutesItem.route.replace(/\\/g, '/'), module: imported.default ?? imported, }; })