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 download url for public OAS #8763

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

shahednasser
Copy link
Member

Closes #8762

Copy link

vercel bot commented Aug 26, 2024

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

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 26, 2024 11:02am
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Aug 26, 2024 11:02am
api-reference-v2 ⬜️ Ignored (Inspect) Visit Preview Aug 26, 2024 11:02am
docs-ui ⬜️ Ignored (Inspect) Aug 26, 2024 11:02am
docs-v2 ⬜️ Ignored (Inspect) Aug 26, 2024 11:02am
medusa-docs ⬜️ Ignored (Inspect) Aug 26, 2024 11:02am
resources-docs ⬜️ Ignored (Inspect) Aug 26, 2024 11:02am

Copy link

changeset-bot bot commented Aug 26, 2024

⚠️ No Changeset found

Latest commit: bfffb7d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -161,7 +161,7 @@ async function getOASFromCodebase(
async function getPublicOas(
apiType: ApiType,
) {
const url = `https://docs.medusajs.com/v2/api/download/${apiType}`
const url = `https://docs.medusajs.com/v2/api/api/download/${apiType}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: why is it /api/api?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to how the API reference is built, we have to use a base path /v2/api to have routes like /v2/api/store and /v2/api/admin, which means actual APIs in the project are under /v2/api/api.

This setup wasn't in the v1 API reference because it was the main proxy project (i.e. no other projects redirecting to it based on the page's path). For the v2 API reference, using just a /v2 base path causes redirect and 404 errors when trying to fetch its static files (CSS, js, etc...) through the proxy (as it tries to fetch these files from other doc projects). So, it has to be under a /v2/api base path.

@olivermrbl olivermrbl merged commit ba24e68 into develop Aug 28, 2024
23 checks passed
@olivermrbl olivermrbl deleted the fix/oas-cli-url branch August 28, 2024 12:23
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.

Fix URL in getPublicOas Function to Correct API Spec Download Path @medusajs/medusa-oas-cli
2 participants