Write OpenAPI specs that import into ready-to-run requests
Importing an OpenAPI spec turns every operation into a request. How useful those requests are depends almost entirely on the spec. Generated specs with no summaries, no examples and no security definitions import as a list of anonymous requests with "string" in every field. A few additions to the spec fix that, and they make your docs, SDKs and mocks better at the same time.
Names: summary
The request name is the operation's summary, then its operationId, then the method and path.
paths:
/orders/{orderId}/refunds:
post:
summary: Refund an order
operationId: createRefund"Refund an order" is what people search for in the collection tree and read in CI reports. createRefund is fine for SDKs; postOrdersOrderIdRefunds helps nobody.
Folders: tags
Each operation goes into a folder named after its first tag. Give every operation a tag, and put the most specific one first:
tags: [Refunds, Orders]Untagged operations land at the top of the collection, unsorted.
Values: examples
For parameters and bodies, the importer uses, in order: example, the first of examples, default, the first enum value, and only then a placeholder shaped like the schema.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RefundRequest'
example:
amount: 19.99
reason: damaged_item
notifyCustomer: trueWrite examples that work on your staging or local API: a real-looking amount, a reason from the enum, not "string" and 0. Then the imported request succeeds on the first send, which is the moment people decide whether to trust the collection.
Path parameters become {{orderId}} variables, so put an id that exists on staging in your environment, not in the spec.
Docs: description and deprecated
An operation's description becomes the request's docs, and deprecated: true adds a Deprecated. line on top. Parameter descriptions show next to each query parameter and header.
Responses: examples too
Each documented 2xx response becomes a saved example on the request, from its example or a sample of its schema. Error responses become examples only when you give an explicit example, so add them for the errors that matter:
'409':
description: Order already refunded
content:
application/json:
example: { error: already_refunded, message: "Order 4812 was refunded on 2026-11-20." }Environments: servers
Each entry in servers becomes an environment with baseUrl (when you import with environments), and the first one becomes the collection's {{baseUrl}}. Name them:
servers:
- url: http://localhost:8080
description: Local
- url: https://staging-api.example.com
description: StagingAuth: securitySchemes
Global security becomes the collection's auth, and an operation's own security overrides it:
| Scheme | Imported as |
|---|---|
| HTTP bearer | bearer token {{bearerToken}} |
| HTTP basic | basic auth with {{username}} and {{password}} |
| API key | {{apiKey}} in the header or query parameter the scheme names |
| OAuth 2.0 (client credentials, authorization code, password) | OAuth 2.0 with the token URL and scopes, and {{clientId}} / {{clientSecret}} |
| OAuth 2.0 implicit only, OpenID Connect | bearer token, with a note |
The environments get empty secret variables for those credentials, ready to fill in.
Check it
requestarium import openapi.yaml --previewLook for requests named after their path, folders you didn't expect, and notes. Fix the spec, preview again. When it imports cleanly, link the collection to the spec so it follows future changes.