Allow uploading of OpenAPI spec for resources#645
Open
285729101 wants to merge 1 commit intoMerit-Systems:mainfrom
Open
Allow uploading of OpenAPI spec for resources#645285729101 wants to merge 1 commit intoMerit-Systems:mainfrom
285729101 wants to merge 1 commit intoMerit-Systems:mainfrom
Conversation
Parse OpenAPI 3.x specs (JSON/YAML) and register endpoints as x402 resources. Includes dry-run preview mode, file upload, and paste support.
Contributor
|
@285729101 is attempting to deploy a commit to the Merit Systems Team on Vercel. A member of the Team first needs to authorize it. |
| try { | ||
| const response = await fetch( | ||
| endpoint.url.replace('{', '').replace('}', ''), | ||
| { |
Contributor
| try { | ||
| const response = await fetch( | ||
| endpoint.url.replace('{', '').replace('}', ''), | ||
| { |
Contributor
| } | ||
|
|
||
| // Register each endpoint | ||
| const results = await Promise.allSettled( |
Contributor
Author
|
@jasonhedman the spec parser auto-discovers endpoints and generates resource entries with a dry-run preview before committing. Let me know if you want any changes to the import flow. |
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.
Adds support for uploading/pasting OpenAPI specs to bulk-register x402 resource endpoints. Resolves #97.
What this does
lib/openapi/parse-spec.ts) that handles both JSON and YAML formats, extracts endpoints with their methods, query params, body schemas, and response schemasregisterFromOpenAPISpectRPC endpoint with dry-run mode so users can preview what will be registered before committingHow it works
The parser handles
$refresolution, server variable substitution, and nested schema extraction. No new dependencies needed - the YAML parser is a lightweight built-in that covers the OpenAPI subset.