fix: oas CLI to convert Windows paths to unix (#12254)

* fix: oas CLI to convert Windows paths to unix

* Create tidy-pigs-heal.md

* refactor: revert to isolate the issue

* refactor: add back the change with logs

* fix: remove external dependency
This commit is contained in:
Harminder Virk
2025-04-22 18:11:58 +05:30
committed by GitHub
parent ad74ba2ca4
commit 71a9a7210c
2 changed files with 19 additions and 8 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/medusa-oas-cli": patch
---
fix: oas CLI to convert Windows paths to unix

View File

@@ -179,14 +179,20 @@ async function getOASFromPaths(
customBaseFile?: string
): Promise<OpenAPIObject> {
console.log(`🔵 Gathering custom OAS`)
const gen = await swaggerInline(additionalPaths, {
base:
customBaseFile ?? path.resolve(basePath, "oas", "default.oas.base.yaml"),
format: ".json",
logger: (log) => {
console.log(log)
},
})
const gen = await swaggerInline(
additionalPaths.map((additionalPath) => {
return additionalPath.replace(/\\/g, "/")
}),
{
base:
customBaseFile ??
path.resolve(basePath, "oas", "default.oas.base.yaml"),
format: ".json",
logger: (log) => {
console.log(log)
},
}
)
return (await OpenAPIParser.parse(JSON.parse(gen))) as OpenAPIObject
}