Contract Mapping
Home / Contract Mapping
API Contract Mapping for Spec‑Less Gateways
Kong, kgateway and APISIX route traffic without OpenAPI contracts, leaving imported APIs with incomplete definitions. DigitalAPI matches each route to its contract from repositories, Postman, SwaggerHub or ZIP uploads. Rule-based matching runs first, followed by AI, with uncertain matches flagged for human review.












Definition
What Is API Contract Mapping?
API contract mapping pairs an API that a gateway serves with the contract that describes it. Gateways such as Kong, kgateway and APISIX hold routes and services but no OpenAPI contract, so the contract has to come from wherever your teams keep it.
In the DigitalAPI API Marketplace, mapping contracts is one of the six steps every gateway connector covers, between importing products and issuing keys.
The problem
Why Do Spec-Less Gateway Imports Arrive as Outlines?
A gateway import can only bring what the gateway holds. For Kong services, kgateway routes and APISIX routes, that is a name and a path, not the operations and schemas developers need.
Contract sources
Where Can Your Contracts Come From?
Each gateway connection records where its contracts live, so mapping reads from the systems your teams already use. Contract files rarely arrive tidy, so the import also handles messy bundles:
- Several API documents in one file
- YAML saved with a .json extension
- A file that is just a list of links
How matching works
How Does Two-Stage Matching Pair Routes With Contracts?
Rules settle the obvious cases quickly. Only what they leave over goes to AI, and AI has to show its working.
Rules score routes and names exactly
Routes and names on both sides are scored first. Clear pairs are settled here, quickly, before any AI is involved.
AI reads both sides, then states its confidence
For routes the rules could not settle, AI reads the route and the candidate contracts, proposes a pairing and must give its confidence and its reason.
Confident pairs bind on import
The contract is attached as each API is imported, so the listing arrives complete.
The rest wait for review
Anything below the confidence bar goes to a review screen with its score and reason.
No AI provider? Rules run alone
Matching still runs on rules when no AI provider is configured.
Review
What Does a Person Review Before a Contract Is Bound?
AI never attaches a contract unattended when it is unsure. The reviewer sees the proposal and the reasoning, and decides.
01
A score on every proposal
So the reviewer knows how sure the match was before looking closer.
02
The reason in plain words
Every AI proposal states why it paired the two, so the check is quick.
03
The person decides
Pairs below the confidence bar are never attached until someone approves them.
04
More than one contract
One listing can take several contracts when an API is split across files.
How we compare
How Does DigitalAPI Compare to the Alternatives?
Without contract mapping, teams either publish what the gateway holds or copy a contract onto each listing by hand.
| Capability | Publish what the gateway holds | Attach contracts by hand | |
|---|---|---|---|
| Spec-less routes in the catalogue | Complete listings with contracts | Name and path only | Complete, one API at a time |
| Where contracts come from | Repos, Postman, SwaggerHub or a zip | Nowhere | Copied in by whoever does it |
| Obvious pairs | Settled by rules on import | Not paired | Paired by hand |
| Uncertain pairs | AI proposal with confidence and reason | Not paired | Depends on who checks |
| Wrong contract attached unattended | Never below the confidence bar | Not applicable | Possible, no second check |
Frequently asked questions
API Contract Mapping FAQs
What is API contract mapping?
+
API contract mapping pairs an API that a gateway serves with the contract that describes it. In the DigitalAPI API Marketplace it turns gateway APIs that carry no specification into complete listings, with their operations and schemas taken from the contract.
Which gateways need contract mapping?
+
Gateways that route traffic without holding an OpenAPI contract, such as Kong services, kgateway routes and APISIX routes. Without mapping, imports from them arrive as outlines with a name and a path.
Where can contracts be imported from?
+
Each gateway connection records where its contracts live: a repository on GitHub, Bitbucket or Azure Repos, a Postman workspace, SwaggerHub, or an uploaded zip of spec files. Messy bundles are handled too, such as several documents in one file, YAML saved as JSON, or a list of links.
How does DigitalAPI match routes to contracts?
+
In two stages. Rules score routes and names first, which settles the obvious cases quickly. Only the leftovers go to AI, which reads both sides, proposes a pairing and must state its confidence and its reason.
Could AI attach the wrong contract?
+
Not unattended. Confident pairs are bound automatically as each API is imported. Anything below the confidence bar waits on a review screen with its score and reasoning, and a person decides.
Do we need an AI provider to use contract mapping?
+
No. Without an AI provider the rules run alone.
Can one API listing have more than one contract?
+
Yes. One listing can take several contracts, for example when an API is described across more than one file.
How does contract mapping relate to gateway connectors?
+
It is one of the six lifecycle steps every DigitalAPI gateway connector covers: connect and test, import APIs, import products, map contracts, issue keys and collect usage. Runtime traffic and keys stay on your gateway.
















Azure ReposRepository.avif)
