feat: import OpenAPI descriptions into resource drafts - #8
Merged
Merged
Conversation
SergeevDmitry
approved these changes
Sep 4, 2026
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
Adds
agent-commerce import openapi <file>, which reads a local OpenAPI3.0/3.1/3.2 document (YAML or JSON) and writes Agent Commerce resource drafts
for review. Merchants who already describe their API in OpenAPI no longer have
to hand-write the
resources:block.The importer produces configuration and stops there. A human reviews the
drafts and merges them into
config.yaml, and from that point an importedresource goes through the same parser, registry and pipeline as one typed by
hand.
Pricing and exposure are never inferred: without
--freeand--exposethefragment has no
pricingorexposekeys and will not load until someonedecides them. Credentials are never imported either. Anything the gateway
cannot represent, such as a required multipart body or a
deepObjectqueryparameter, skips the operation rather than being approximated; the optional
equivalents are omitted with a warning.
docs/openapi-import.mdhas the fullsupport matrix.
One runtime change comes with it.
BackendHandlergains an optionalinputBindingsfield, exposed asbackend.inputBindings, so a request cancarry path parameters, query parameters and a JSON body at once. Absent
bindings keep the old behaviour exactly, so existing configs are unaffected.
PROTOCOL_NAMESwas also added so config validation and--exposecheckprotocol names against one definition. Both are recorded in
docs/contracts.md.@scalar/openapi-parser@0.29.0is a new dependency. It needs zod 4, so therepo-wide
overrides.zodwas narrowed to the three x402 packages that sharezod values with ours. A default install goes from about 48 MB to about 65 MB,
and the README claim was updated.