Skip to content

feat: serve OpenAPI discovery at /openapi.json#466

Closed
brendanjryan wants to merge 2 commits intomainfrom
feat/openapi-json-route
Closed

feat: serve OpenAPI discovery at /openapi.json#466
brendanjryan wants to merge 2 commits intomainfrom
feat/openapi-json-route

Conversation

@brendanjryan
Copy link
Copy Markdown
Collaborator

Adds an /api/openapi.json route that generates an OpenAPI 3.1.0 discovery document using mppx/discovery, plus a Vercel rewrite so https://mpp.dev/openapi.json serves it.

The document describes the site's paid endpoints with x-payment-info metadata for agent discovery.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mpp Error Error Mar 25, 2026 10:20pm

Request Review

@brendanjryan
Copy link
Copy Markdown
Collaborator Author

Redundant — #462 already added the openapi route. Will open a follow-up for just the /openapi.json rewrite.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ac38b5d19

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

{
handler: mppx.charge({
amount: "0.1",
currency: USDC,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use configured currency in OpenAPI discovery

The discovery document advertises payment metadata from a hardcoded USDC address here, but the actual /api/ping/paid endpoint charges import.meta.env.VITE_DEFAULT_CURRENCY in src/pages/_api/api/ping/paid.ts. In any deployment where that env var differs (the repository’s .env.example already uses a different address), /openapi.json will publish incorrect x-payment-info, causing clients that rely on discovery to pay with the wrong token and fail when they hit the real Challenge flow.

Useful? React with 👍 / 👎.

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.

1 participant