-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(medusa-oas-cli): fix tool not working in Medusa backends #6812
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Ignored Deployments
|
🦋 Changeset detectedLatest commit: 8c4a583 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
/snapshot-this |
🚀 A snapshot release has been made for this PRTest the snapshots by updating your yarn add @medusajs/core-flows@0.1.0-snapshot-20240325085803 yarn add @medusajs/event-bus-redis@1.8.12-snapshot-20240325085803 yarn add @medusajs/client-types@0.2.11-snapshot-20240325085803 yarn add @medusajs/link-modules@0.2.10-snapshot-20240325085803 yarn add @medusajs/medusa@1.21.0-snapshot-20240325085803 yarn add medusa-test-utils@1.1.43-snapshot-20240325085803 yarn add @medusajs/modules-sdk@1.12.10-snapshot-20240325085803 yarn add @medusajs/medusa-oas-cli@0.3.2-snapshot-20240325085803 yarn add @medusajs/orchestration@0.5.6-snapshot-20240325085803 yarn add @medusajs/product@0.4.0-snapshot-20240325085803 yarn add @medusajs/promotion@0.0.3-snapshot-20240325085803 yarn add @medusajs/types@1.12.0-snapshot-20240325085803 yarn add @medusajs/user@0.0.3-snapshot-20240325085803 yarn add @medusajs/utils@1.11.8-snapshot-20240325085803 yarn add @medusajs/workflows-sdk@0.1.5-snapshot-20240325085803
|
What
This PR fixes the error shared in issue #6810 due to changing the location of the OAS.
Why
Since we changed the location of the OAS to be in the
docs-util/oas-output
directory, the OAS yaml files are no longer shipped with Medusa. This caused an error when trying to run the tool in a separate Medusa backend.Considering moving forward with V2 we won't include the OAS inline with endpoints as well, the approach proposed by this PR is to load the OAS file from the public API reference rather than the local files.
The only downside to this is that developers will always get the OAS of the latest Medusa version rather than the current version they're running. If we find this to be an issue, we can revisit this later and see how we can address it.
This PR also adds a
--local
option to the OAS CLI tool so that we can still generate OAS files in the monorepo for our references.Additional Changes
--local
option where necessarydownload
endpoint in the API reference project to accept a version query parameters (for v1/v2).