HTTP Collections#
For ad-hoc API exploration without codegen, generate importable request files from /openapi.json.
VS Code REST Client (.http files)#
Generate .http files from the spec using jq:
curl -s http://localhost:3000/openapi.json | jq -r '
.paths | to_entries[] | .key as $path |
.value | to_entries[] |
"\(.key | ascii_upcase) http://localhost:3000\($path)\n\n###\n"
' > api-requests.httpOpen api-requests.http in VS Code with the REST Client extension. Click “Send Request” above any block.
For authenticated endpoints, add a header block:
### Authenticated request
GET http://localhost:3000/me
x-user-id: google|your-subject-id
###Bruno#
Import the OpenAPI spec directly into Bruno:
- Open Bruno
- Collection > Import Collection
- Select OpenAPI V3 as the format
- Point at
http://localhost:3000/openapi.jsonor paste the JSON
Bruno creates a request for each operation, organized by path.
IntelliJ / JetBrains#
JetBrains IDEs natively support .http files. Use the same jq recipe above, or import via:
- File > New > HTTP Request
- Convert from > OpenAPI Specification
- Enter
http://localhost:3000/openapi.json
Insomnia / Postman#
Both import OpenAPI specs directly:
- Import > From URL
- Enter
http://localhost:3000/openapi.json
The collection auto-updates when you re-import.
curl one-liner#
Fetch the spec and list all endpoints:
curl -s http://localhost:3000/openapi.json | \
jq -r '.paths | to_entries[] | .key as $p | .value | keys[] | "\(. | ascii_upcase) \($p)"'