No copying URLs by hand
Every collection, every declared filter, sort, fields, count, create, update, delete and action, as requests you can send straight away. From the discovery document, which already says all of it.
Tools · Use an API · v0.2.0
restep-exportRequests, readyTurns a discovery document into ready-made requests for Bruno, Postman or .http files: lists with sample filters, writes with their headers, and the actions.
Node 18 or later · npm install -g restep-export
Every collection, every declared filter, sort, fields, count, create, update, delete and action, as requests you can send straight away. From the discovery document, which already says all of it.
Idempotency-Key on creates, If-Match on updates and deletes, application/merge-patch+json on PATCH. The requests teach the contract while you use them.
.http files for VS Code and JetBrains, a Bruno collection or a Postman one. Or all three at once.
The token it uses to read the API never lands in the files. They get a {{token}} variable, kept as a secret in Bruno and in a separate file for JetBrains.
rel="service-desc") or from a JSON file. With a file it makes no request at all. Its restep has to follow the grammar (1.0, 1.0-draft.6, 1.0-rc.1…) with major version 1: anything else is an error, not something to export as plain core (§1.1).item, create, update and action input schemas that are links on the same origin (§4.3), and the first item of each collection, to use its id as the example.type, on or method it does not know are left out (§4.2).For now its messages and the names and notes of the requests it generates are in Spanish: “Listar books”, “Obtener books”, “Crear en books”. Paths, headers and bodies are the same in any language.
Node 18 or later, no dependencies. Run it with npx, or install it with npm install -g restep-export.
npx restep-export https://demo.restep.wubytes.com/ --to http --out requests
Without --to it writes all three formats; without --out, into ./restep-export. It exits with 0 when it has written everything and 2 when it cannot (arguments, network or an invalid document).
$ npx restep-export https://demo.restep.wubytes.com/ --to http,bruno,postman --out requests
http: /home/ana/requests/http
bruno: /home/ana/requests/bruno
postman: /home/ana/requests/postman
4 colecciones, 42 peticiones.
$ find requests -type f | sort
requests/bruno/books/Accion-new-coleccion.bru
requests/bruno/books/Actualizar-books.bru
requests/bruno/books/Borrar-books.bru
requests/bruno/books/Campos-de-books.bru
requests/bruno/books/Contar-books.bru
requests/bruno/books/Crear-en-books.bru
requests/bruno/books/Filtrar-books-por-category-eq.bru
⋮ one .bru per request, one folder per collection
requests/bruno/books/folder.bru
requests/bruno/bruno.json
requests/bruno/environments/local.bru
⋮
requests/http/.vscode/settings.json
requests/http/books.http
requests/http/categories.http
requests/http/http-client.env.json
requests/http/http-client.private.env.json
requests/http/products.http
requests/http/shop.http
requests/postman/Restep-demo.restep.wubytes.com.postman_collection.json
curl -s https://api.example.com/ > discovery.json
npx restep-export discovery.json --to bruno --out bruno --base-url https://staging.example.com
A discovery document does not say where it lives, so with a file base_url is http://localhost:8080 unless you give --base-url. There is no sample id either: <collection>_id is 1 until you change it.
Against the reference server, which announces relations, each collection with includable relationships gets an “Incluir relaciones” request, and the reviews subcollection takes as parent a book that has reviews:
$ npx restep-export http://localhost:8080/ --to http --out requests
http: /home/ana/requests
6 colecciones, 71 peticiones.
$ grep -A3 "Incluir" requests/products.http
### Incluir relaciones de products
# Relaciones incluidas: category, category.parent, category.showcase (§9). Una relación a varias colecciones lleva type en cada objeto, y una a un elemento de una subcolección, href (§3).
GET {{base_url}}/products?include=category,category.parent,category.showcase&limit=10
Accept: application/json
$ head -12 requests/reviews.http
⋮
@reviews_path_book_id = 12
@reviews_id = 3
⋮
GET {{base_url}}/books/{{reviews_path_book_id}}/reviews?limit=10
npx restep-export https://api.example.com/ --token "$TOKEN" --out requests
The token is used to read discovery and the sample ids, and is not written anywhere. If the API announces the oauth extension, every request gets Authorization: Bearer {{token}}; for an API that wants a token without announcing it, add --auth bearer.
http: REST Client (VS Code) and the JetBrains HTTP clientOne .http file per collection, plus http-client.env.json (environment local with base_url and an empty token), http-client.private.env.json (just the token, for JetBrains; keep it out of version control) and .vscode/settings.json with the same environment for REST Client. This is the start of books.http from the demo, and its writes:
# Restep demo.restep.wubytes.com · books
# Generado por restep-export 0.2.0 a partir del descubrimiento (Restep 1.0-draft.6).
# Books in the catalogue of El Marcapáginas, one per edition.
# base_url y token salen del entorno (http-client.env.json o .vscode/settings.json).
@books_id = 12
@books_etag =
### Listar books
# Pagina siguiendo next de la respuesta hasta que sea null; el cursor es opaco (§5.2, §6.4).
GET {{base_url}}/books?limit=10
Accept: application/json
### Filtrar books por rating (ge)
# Operadores declarados para rating: ge, null (§6.1).
GET {{base_url}}/books?filter[rating][ge]=3&limit=10
Accept: application/json
⋮ one request per declared filter, then sort, fields and count
### Crear en books
# Repetir la petición con la misma Idempotency-Key no crea otro elemento (§7.1); cámbiala para crear otro.
POST {{base_url}}/books
Accept: application/json
Content-Type: application/json
Idempotency-Key: "6ed2d062-3d18-44bc-90c6-83226a857384"
{
"title": "La niebla de Portugalete",
"price": "10.00",
"year": 1,
"published": "2026-01-01",
"reading_time": "PT6H",
"rating": 1.5,
"signed": false
}
### Actualizar books
# Merge patch (§4.3). If-Match lleva la ETag de «Obtener books», con sus comillas (§7.2).
PATCH {{base_url}}/books/{{books_id}}
Accept: application/json
Content-Type: application/merge-patch+json
If-Match: {{books_etag}}
{
"title": "La niebla de Portugalete"
}
In .http files you copy the ETag from “Obtener books” into @books_etag by hand: REST Client and JetBrains chain responses with different syntax, and the files work in both.
bruno: a Bruno collectionbruno.json, a folder per collection with its folder.bru, one .bru per request and environments/local.bru with every variable and token as a secret. Here “Obtener books” stores the ETag after the response, so “Actualizar” and “Borrar” can use it at once; “Listar” stores next in books_next:
meta {
name: Obtener books
type: http
seq: 13
}
get {
url: {{base_url}}/books/{{books_id}}
body: none
auth: none
}
headers {
Accept: application/json
}
script:post-response {
const etag = res.getHeader('etag');
if (etag) bru.setVar('books_etag', etag);
}
docs {
Guarda la ETag de la respuesta en books_etag para usarla en If-Match (§7.2).
}
# environments/local.bru
vars {
base_url: https://demo.restep.wubytes.com
books_id: 12
books_etag:
products_id: 1
products_etag:
categories_id: 1
categories_etag:
shop_etag:
}
vars:secret [
token
]
postman: a Postman v2.1 collectionOne JSON file, <name>.postman_collection.json, with a folder per collection and every variable as a collection variable (base_url, token, books_id, books_etag…). Import it in Postman. The same ETag and next chaining goes in a test script:
{
"name": "Obtener books",
"event": [{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const etag = pm.response.headers.get('ETag');",
"if (etag) pm.collectionVariables.set('books_etag', etag);"
]
}
}],
"request": {
"method": "GET",
"header": [{ "key": "Accept", "value": "application/json" }],
"url": {
"raw": "{{base_url}}/books/{{books_id}}",
"host": ["{{base_url}}"],
"path": ["books", "{{books_id}}"]
},
"description": "Guarda la ETag de la respuesta en books_etag para usarla en If-Match (§7.2)."
}
}
| Request | When |
|---|---|
List, with limit (the smaller of 10 and max_limit) | If methods includes GET or is not declared |
| One per declared filter, with its first operator and a value of its type (§6.1) | With query |
Sort by the first two keys of sort other than id, the first descending (§6.2) | With query and sort |
fields with two top-level fields (§6.3) | With query |
count=true&limit=1 (§6.5) | If count is declared |
Include relations: include with those declared with "include": true and, up to include_depth, those of their targets (category,category.parent); a relationship to several collections only at the end (§9) | With relations |
| Get one item | If item_methods includes GET or is not declared |
Create, with a sample body from the create schema and an Idempotency-Key (§7.1) | POST; the key, with writes |
Update with a merge patch of one field and If-Match: {{<collection>_etag}} (§7.2) | PATCH; If-Match, with writes |
Delete, with If-Match | DELETE; If-Match, with writes |
Each action, at /collection:name or /collection/{{id}}:name, with its method and a body from its input (§11.1) | With the actions extension. With writes, an Idempotency-Key when the action declares "idempotent": false |
Where the collection says "id_from": "client", the create body carries a random id (a UUID, §13.6); without id_from, or with "server", "either" or a value it does not know, it carries none (§5.1). Where idempotency says "anonymous": false and the export has no credentials (no --auth bearer or oauth, no --token or -H Authorization), the requests carry no Idempotency-Key (§7.1). Every POST body, creates and actions, goes with Content-Type: application/json, and a literal + in a query value as %2B.
Each resource in singletons (§5.9) becomes a folder (or a .http file) with “Obtener” and, when methods includes PATCH or is not declared, “Actualizar”, a merge patch with If-Match: {{<name>_etag}}. One whose path is a template or that carries parent is ignored, with a warning. If it shares its name with a collection, its folder is called <name>-recurso. On the demo, shop.http:
### Obtener shop
# Recurso suelto (§5.9). Guarda la ETag en shop_etag para usarla en If-Match (§7.2).
GET {{base_url}}/shop
Accept: application/json
### Actualizar shop
# Merge patch (§5.9). If-Match lleva la ETag de «Obtener shop» (§7.2).
PATCH {{base_url}}/shop
Accept: application/json
Content-Type: application/merge-patch+json
If-Match: {{shop_etag}}
{
"name": "ejemplo"
}
Variables: base_url and token in the environment, <collection>_id (the sample id), <collection>_etag (with writes) and <collection>_path_<var> for each variable of a URI template in a subcollection. With a running API, those variables take the id of a parent item that has items in the subcollection, and <collection>_id one of them, so that “Obtener” does not give 404; from a file or with --no-samples, they are 1.
Sample bodies carry the required fields and the optional scalar ones that are not readOnly. Optional objects, such as relations and language maps, are left out so the example does not point at an item that does not exist. The Idempotency-Key values are fixed UUIDs made at export time, in quotes as Structured Fields wants: sending the request again does not create another item, which is exactly the point. Change the key to create another.
restep-export <url|discovery.json> [options]
| Option | What it does |
|---|---|
--to <formats> | http, bruno or postman, several separated by commas. All three by default |
--out <folder> | Where to write (./restep-export). With several formats, one subfolder per format |
--base-url <url> | The value of base_url. By default, the API root without the final /; with a file, http://localhost:8080 |
--name <name> | The collection’s name. By default Restep <host>, or Restep with a file |
--auth auto|bearer|none | Adds Authorization: Bearer {{token}}. auto, the default: only if the API announces oauth |
--token <token> | Token to read the API while exporting. Never written to the files |
-H, --header "Name: value" | An extra header to read the API. Repeatable. Not written either |
--no-samples | Does not ask the API for a sample id per collection |
-h, --help | Help |
relations it only generates the read with include: the bodies do not link relationships. It does not cover sync, batch, filter-expr or query-method.--no-samples), the variables of a subcollection are 1.200.type, enum, const, default, examples, anyOf and oneOf, a flat allOf, a pattern tried against a few candidates, and the date, date-time, email, uri and uuid formats. It does not follow $ref. A string with another format and no examples gets "ejemplo", which the server may refuse.https nor the root’s (data:, file:) is not followed.named_filters, §6.1), nor for fields on a singleton.deprecations, §5.5) are not marked on the requests that use what they retire.ETag header; it does not read _etag from the body, which §7.2 guarantees even if a proxy weakens the header.href (to an item of a subcollection or from a singleton) are not used: the sample bodies carry no relationships.sync, batch, filter-expr, query-method, inherit), so it does not depend on the declared draft.Browse any Restep API from this site: query forms built from discovery, writes, actions, errors explained and the curl for every request.
A command line client that learns the API from discovery: get, create, update, delete, actions, every page, CSV, and completion in zsh and bash.
An offline-first client: a local replica kept up to date incrementally, writes that queue while offline, and conflicts resolved your way.