feat: add OpenAPI-first discovery tooling#235
Open
brendanjryan wants to merge 16 commits intomainfrom
Open
Conversation
commit: |
- Remove /discover* → 410 Gone shim from proxy (dead paths now 404) - Remove dead serialize(), toServicesMarkdown(), toMarkdown(), pushRoutes() - Use z.looseObject() throughout Discovery schemas so x-* extensions and extra OpenAPI fields (parameters, tags, operationId, etc.) pass through
Proxy pre-generates openapi.json and llms.txt at create() time. Framework helpers (Express, Hono, Next.js) cache after first request via lazy init (preserves dynamic import for code-splitting). Switched docs.llms to relative path so the document is fully static.
…static imports, typed handlers, elysia discovery 1. Proxy buildDiscoveryRoutes() passes through full paymentOf() output instead of hand-picking fields (preserves unitType, recipient, etc.) 2. Collapsed docsLlmsUrl callback to docs.llms string — removed resolveLlmsUrl/resolveLlmsLink dead code, kept input compat 3. Replaced dynamic await import() with static imports in Express/Hono/ Next.js helpers; Express + Next.js precompute at registration time 4. Exported DiscoverableHandler type, updated Wrap to expose _internal metadata — removed as any casts from tests 5. Added Elysia discovery() helper for framework parity
…method keys 1. docs.llms (and all ServiceDocs links) now accept relative paths like /llms.txt — fixes validator rejecting proxy-generated docs 2. Paths modeled as PathItem with explicit get/post/put/etc keys instead of record<string, operation> — path-item-level fields like summary, parameters, x-extensions no longer cause errors 3. Validator iterates only HTTP method keys, skipping path-item fields
The IIFE pattern swallowed c.error() exit codes because the return value was checked as typeof !== 'string' instead of propagating the error. Refactored to flat if/else.
de3e4fb to
0dfbeb9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mppx/discoverymodule with OpenAPI generation and validation helpersdiscovery()helpers for Hono, Express, and Next.jsmppx/proxyOpenAPI-first with/openapi.json, keep/llms.txt, and rm legacy/discover*mppx discover validate <url-or-file>to the CLIDetails
mainchargeandsessionx-service-infoValidation
Breaking change
mppx/proxyno longer serves/discover*as a discovery API surface/openapi.jsonis the canonical machine-readable contract and/llms.txtis the text-friendly derivative