Closed jamescjensen closed 7 months ago
A temporary workaround: copy the admin base file and the store base file to {your project's root folder}/docs-util/oas-output/base
. This will not stay up to date with updates on medusa's end, however
Thank you for opening this issue, will open a PR that resolves this
@jamescjensen can you install the following snapshot and test it out using the same command:
yarn add @medusajs/medusa-oas-cli@0.3.2-snapshot-20240325085803
@shahednasser that worked on my end! thanks for the quick fix!
Sure! The fix will come out in the next release
Bug report
Describe the bug
After upgrading medusa-oas to 0.3.1, oas files cannot be generated unless base files are copied to
../../../../docs-util/oas-output
or a base file override is declared.System information
Medusa version (including plugins): @medusajs/medusa-oas-cli 0.3.1, @medusajs/medusa 1.20.3 Node.js version: 20.11.0 Database: Postgres Operating system: MacOS Browser (if relevant):
Steps to reproduce the behavior
Run
medusa-oas oas
in a project where../../../../docs-util/oas-output
does not contain oas files.Expected behavior
An oas file is correctly generated.
Screenshots
Code snippets
Looking at the oas code here, this is because oasOutputPath is incorrectly being used outside v2:
..later:
Because medusa's generated oas docs are not at
../../../../docs-util/oas-output
from my project's base folder, the oas generator fails. The previous version of this code usedmedusaPackagePath
for this purpose.Additional context
You also cannot work around this with a custom base file, because even if it is set, "getOASFromCodebase" is always called with the argument for it as undefined.