Skip to content
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

Merged
merged 3 commits into from
Mar 26, 2024

Conversation

shahednasser
Copy link
Member

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

  • Pass the --local option where necessary
  • Modify the download endpoint in the API reference project to accept a version query parameters (for v1/v2).

Copy link

vercel bot commented Mar 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference 🔄 Building (Inspect) Visit Preview Mar 25, 2024 6:05pm
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 25, 2024 6:05pm
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
docs-ui ⬜️ Ignored (Inspect) Visit Preview Mar 25, 2024 6:05pm
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Mar 25, 2024 6:05pm

Copy link

changeset-bot bot commented Mar 25, 2024

🦋 Changeset detected

Latest commit: 8c4a583

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@medusajs/client-types Patch
@medusajs/medusa-oas-cli Patch
@medusajs/oas-github-ci Patch

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

@shahednasser
Copy link
Member Author

/snapshot-this

Copy link
Contributor

🚀 A snapshot release has been made for this PR

Test the snapshots by updating your package.json with the newly published versions:

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

Latest commit: 0deb277

@shahednasser shahednasser merged commit e005987 into develop Mar 26, 2024
30 checks passed
@shahednasser shahednasser deleted the fix/oas-v2-error branch March 26, 2024 07:33
@github-actions github-actions bot mentioned this pull request Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

medusa-oas points to a base file in an undocumented relative folder after 0.3.1
3 participants