Multiple OpenAPI Specs on the Same URL
Each REST API domain in Aikido holds one OpenAPI spec, and each domain URL must be unique. If several services sit behind the same base URL, each with its own spec, add the same URL once per spec and make each entry unique with a named URL fragment, such as #orders or #billing.
How it works
A URL fragment is the part after #. Browsers and HTTP clients never send it to the server. Aikido treats https://staging.example.com/api#orders and https://staging.example.com/api#billing as 2 separate domains, but every scan request from both goes to https://staging.example.com/api.
| Domain in Aikido | OpenAPI spec | Requests go to |
|---|---|---|
https://staging.example.com/api#orders | orders-openapi.json | https://staging.example.com/api |
https://staging.example.com/api#billing | billing-openapi.json | https://staging.example.com/api |
Add a spec for the same URL
- Go to Domains and click Add Domain.
- Expand Advanced and select REST API.
- Enter the base URL with a fragment named after the service, e.g.
https://staging.example.com/api#orders. - Add the OpenAPI spec for this service. See REST API & Web App Scanning for the spec options.
- Repeat with a new fragment name, e.g.
#billing, for each additional spec.
Authentication and additional headers are set per domain. Configure them on every fragment domain that needs them.