with one click
api-discovery-swagger-openapi-probing
// Probe and discover REST API endpoints through OpenAPI/Swagger specification files and Swagger UI configuration
// Probe and discover REST API endpoints through OpenAPI/Swagger specification files and Swagger UI configuration
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | api-discovery-swagger-openapi-probing |
| description | Probe and discover REST API endpoints through OpenAPI/Swagger specification files and Swagger UI configuration |
| tech_stack | ["web"] |
| capability | ["api-design"] |
| version | OpenAPI 3.0.4 |
| collected_at | "2025-01-01T00:00:00.000Z" |
Source: https://swagger.io/docs/specification/basic-structure/, https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/, https://swagger.io/docs/specification/paths-and-operations/
Discover, explore, and interact with REST APIs by reading OpenAPI 3.0 specification files (swagger.json, swagger.yaml, openapi.json) and configuring Swagger UI for interactive probing. Covers the structure of OpenAPI definitions, how to locate API endpoints from spec files, and how to wire up Swagger UI to browse and test discovered APIs.
The top-level keys reveal the API surface immediately:
openapi — spec version (3.0.0–3.0.4)info → title, version, description — API identityservers — base URLs (multiple for prod/staging)paths — every endpoint and its HTTP methodscomponents/schemas — data models referenced via $ref# The paths object IS the endpoint catalog
paths:
/users: # → GET /users, POST /users
get: ...
post: ...
/users/{id}: # → GET /users/5, PATCH /users/5, DELETE /users/5
get: ...
patch: ...
delete: ...
Each path + HTTP method combination is a unique operation. Full URL = <server-url> + path.
Curly braces mark path parameters: /users/{id}, /report.{format}. Query parameters are separate — they appear under parameters with in: query, never inline in the path string.
SwaggerUI({
url: "https://target-api.example.com/swagger.json",
dom_id: "#swagger-ui",
deepLinking: true,
tryItOutEnabled: true,
presets: [SwaggerUI.presets.ApisPreset],
layout: "StandaloneLayout"
})
Use spec (JS object) instead of url to load a spec without hosting it. Use urls (array of {url, name}) to load multiple specs with a topbar selector.
| Method/Param | Purpose |
|---|---|
SwaggerUI({ url, dom_id }) | Bootstrap Swagger UI against a spec URL |
SwaggerUI({ spec }) | Pass a JS object directly, bypassing URL fetch |
SwaggerUI({ urls }) | Load multiple API specs with a dropdown selector |
requestInterceptor / responseInterceptor | Inspect or mutate every request/response (useful for auth headers, logging) |
tryItOutEnabled: true | Enable "Try it out" by default for rapid probing |
supportedSubmitMethods | Restrict which HTTP methods allow Try-it-out |
filter: true | Enable tag-based operation filtering for large specs |
docExpansion: "full" | Expand all operations on load |
preauthorizeApiKey(name, token) | Pre-fill API key / Bearer token (OAS 3.0: token only, no "Bearer" prefix) |
preauthorizeBasic(name, user, pass) | Pre-fill Basic auth credentials |
/users are invalid even with different query params. If you need different GET behaviors, use distinct paths like /users/findByName vs /users/findByRole./users?role={role} in the paths section. Define role as a query parameter under the operation.info.version ≠ openapi version: info.version is your API version (arbitrary string like 1.0-beta). The openapi key (e.g., 3.0.4) is the spec format version.swagger: "2.0", host, basePath, schemes. OAS 3.0 replaces those with openapi: 3.0.x and servers. Specs fetched as swagger.json may be either version — check the top-level key.configUrl document, which overrides the JS config object. When debugging, check all three.preauthorizeApiKey for Bearer: Do NOT include the Bearer prefix — just the raw token string.validator.swagger.io by default. Set validatorUrl to none or localhost for offline/private APIs.withCredentials: true only sends existing browser cookies.requestInterceptor to inject auth headers discovered through other probing techniquesservers list is empty or wrong, override via Swagger UI config or patch the spec JS object before passing to SwaggerUI({ spec })urls + urls.primaryName to present all versions in one UI