Swagger UI without OpenAPI
Type the root of a Restep API and the whole interface comes out of its discovery document: collections, query forms, items, writes and actions. Nothing to describe twice.
Tools · Use an API · v0.2.0
ExplorerBrowse any APICollections, query forms built from discovery, items with their relations, writes, actions and errors explained, with the curl for every request. In your browser, nothing to install.
In the browser · nothing to install
Type the root of a Restep API and the whole interface comes out of its discovery document: collections, query forms, items, writes and actions. Nothing to describe twice.
Each filter offers only its declared operators, with the right control: a list for an enum, yes or no for null, a date picker for a date. Sort keys, fields and limit up to max_limit, too.
The last eight requests stay below, each with its curl, the response headers and the body. Errors come explained: what the code means and what to do about it.
It runs in this site, in English and Spanish, with no dependencies, no CDN and no outside fonts. Your token stays in the tab and only goes to the API.
fetch: there is no server of ours in between.restep string), it uses it. If not, it follows the first Link with rel="service-desc" that leads to one. If there is none, it assumes only core and lets you go to any path by hand.#api=<root>&path=<path and query>. Back and forward work, and you can share a link to a filtered page or an item. The token never goes in it.The quickest way to see it: the demo API, a bookshop with books, products named in several languages and nested categories. It allows CORS, and you can write to it: the data goes back to the start every hour.
Open the explorer, type the root of your API (for example https://api.example.com/v1/) and press Explore. If it needs a token, open Token and language, paste it and press Use.
The explorer runs on restep.wubytes.com and your API is somewhere else, so the browser only lets them talk if your API allows CORS. That is the one thing you may need to change: see the next section.
An API on http://localhost:… works from this site in Chrome and Firefox, which treat localhost as secure, as long as it sends the CORS headers. Chrome may also ask for Access-Control-Allow-Private-Network: true on the preflight. Any other API on plain http: is blocked by the browser as mixed content: it needs https:.
If you build on restep-server, the cors: true option answers the preflight and exposes the headers. The single-file reference server sends no CORS headers, so with it you have to serve the explorer and the API from the same origin.
# On every response, errors included:
Access-Control-Allow-Origin: * # or https://restep.wubytes.com
Access-Control-Expose-Headers: ETag, Location, Link, Allow, WWW-Authenticate, Retry-After,
Idempotent-Replayed, Preference-Applied, Content-Language, Deprecation, Sunset, Accept-Patch
# On the preflight (OPTIONS with Access-Control-Request-Method):
Access-Control-Allow-Methods: GET, HEAD, POST, PATCH, DELETE
Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-None-Match,
Idempotency-Key, Prefer, Accept-Language
Access-Control-Max-Age: 600
Without a header in Expose-Headers, the browser hides it from the page even though it arrived. What you lose with each one:
ETag: the explorer cannot read an item’s ETag, so to write with If-Match it needs _etag in the representation. It tells you when there is neither.Location: after a create it goes to the new item by the id in the body instead.WWW-Authenticate: it cannot show the challenge of a 401 or the link to the OAuth metadata. The oauth extension already asks you to expose it.Link: it cannot follow a service-desc when the root is not the discovery document.Idempotent-Replayed: it cannot tell you that a create was a replay.Access-Control-Allow-Headers: * does not cover Authorization: name it. And Access-Control-Allow-Origin: * works with a token, because the explorer sends it in Authorization, not in cookies.
Each link opens the explorer at that spot on the demo API.
Crime novels, dearest first. The form above the table already has the filter and the sort key in place. Change them, and the line under the form shows the request you are about to make before you press Query:
GET /books?filter[category]=novela-negra&sort=-price
Product 1 has its name in five languages. The item view lists them all and marks the one tables show, chosen by your Accept-Language or your browser’s language. Its category is a link to categories/3. Under the fields you get the item’s ETag, then Edit (PATCH) and Delete (DELETE).
A price that is not a decimal gets a 400. The explorer shows its code, detail and parameter, and what to do: “The resource accepts it, but the value is wrong: fix it and try again.” In Requests, the same call as curl:
curl -i -g 'https://demo.restep.wubytes.com/books?filter[price]=abc' -H 'Accept: application/json'
{
"type": "https://w3id.org/restep/1/errors#invalid_parameter",
"title": "Bad request",
"status": 400,
"code": "invalid_parameter",
"detail": "abc is not a valid decimal.",
"parameter": "filter[price]"
}
Restep and API versions (with a warning when it is a draft or a candidate, and nothing more on offer when it is not Restep 1), profiles, extensions, how long an Idempotency-Key is kept, announced retirements with their date (§5.5), and a Check button for the status resource. Then a card per collection with its path, description, methods, filters with type and operators, sort keys, limit, count, relations, language maps, inherited fields, actions and schemas, and a card per singleton. At the end, the full discovery document. The sidebar lists the collections and the singletons; subcollections show up there but open from an item of their parent.
enum and boolean, yes or no for null, a date picker for date, and a hint for decimal, datetime, duration and lists in in.fields): from the item schema when it is embedded, and from the items on the page. None checked means all.include), when the API has relations: it offers the paths up to include_depth, such as category.parent, and a relationship to several collections only at the end of the path.limit up to max_limit, and Count the total when count is declared, exact or estimated.Below, the items in a table (the id opens each one), how many are on the page and the total if you asked for it. Next page follows next exactly as it came (§5.2), and First page drops the cursor. If the collection declares actions or accepts POST, their forms come last.
All its fields. Language maps show every translation. Inherited fields (§11.6) say which own field they are written in and where the value comes from, from _inherited; an unknown from shows as a source you cannot see ("hidden"). Relations are links, by their href when they carry one (it is required towards an item of a subcollection), and so are subcollections. Then the item’s actions, editing and deleting.
Each resource in singletons (§5.9), such as /shop on the demo, has its link in the sidebar and its view, with its fields and its ETag, and Edit (the minimal merge patch, with If-Match) when methods includes PATCH or is not declared. Singletons with a template in path or with parent are ignored.
The bar above the view, Path, relative to the root, goes to any path with any query, also on an API without a discovery document. What it does not recognise as a collection or an item it shows as raw JSON. Reload reads discovery again.
The last eight requests of the tab: method, path, status and time, the curl with a Copy button, the response headers that CORS lets the page read, and the body as it came.
create schema, each with its default, its first enum value or an empty value of its type. Where the collection says "id_from": "client", the body starts with a random id; with an id_from it does not know, the id is always removed before sending (§5.1). Once created, it takes you to the new item.id, the _ members, readOnly fields and effective inherited fields. Edit it and press Save changes: it sends only what changed, as a JSON Merge Patch (removing a field sets it to null; relations go whole). If nothing changed, it sends nothing.When the API announces writes:
If-Match goes on every edit and delete, with the item’s ETag: _etag if the representation carries it, and if not the ETag header of a full read. The form shows which one it will send. If someone changed the item meanwhile, you get a 412 and the hint to reload it and apply your change again (§7.2).Idempotency-Key is generated for every POST, creates and non-idempotent actions, and shown on the form. If the request gets no response, say the network dropped, the same key stays for the retry, so the API does not repeat the effect. After any response it makes a new one (§7.1). Where idempotency says "anonymous": false, a POST without a token carries no key.Actions (§11.1) take the ones the item lists in _actions, the ones available in its current state, or else the declared ones. Each has its method, a body from its input schema and badges for safe and idempotent. The explorer does not validate bodies against schemas before sending: the API does, and its 422 comes out with the table of errors.
restep has to follow the grammar (1.0, 1.0-draft.6, 1.0-rc.1…) with major version 1. If not, the overview says it is not Restep 1 and offers nothing else; it does not fall back to core.inherit, and uses it (read-only effective field when editing, origin from _inherited) only if the API announces the inherit extension and declares exactly "restep": "1.0-draft.6". With another version it ignores those members and says so in the overview. Of sync and batch it only shows what they declare.type is not offered, nor are unknown operators; an action with an unknown on or method (also in _actions) is not offered; a deprecation notice whose kind does not fit its place is not shown.https nor the root’s.POST, creates and actions, also with a {} body, goes with Content-Type: application/json, and a literal + in the query goes as %2B.sessionStorage, so it goes when you close the tab, under a key per API origin. Forget removes it at once."Authorization: Bearer $RESTEP_TOKEN".Accept-Language you chose go to localStorage.innerHTML. The link to the other language keeps the API and the path, never the token.There are no shortcuts of its own: everything works with Tab, Enter and the browser’s back and forward. Every control has a label. On each navigation the focus moves to the view’s heading, notices are read by an aria-live region, and adding a filter or sort key moves the focus to it. The theme button cycles through automatic, light and dark, and the layout fits a phone.
sync (:changes, SSE notifications), batch, filter-expr or query-method. A filter=… expression typed in the path bar is kept, but there is no form for it.parent (§4.2).id_from, collations or parent, and responses that carry Deprecation are not flagged (the header only shows in the request log).fields form, and its relations show as JSON, without following their href.Cache-Control (§4.2): it reads it again when you change API, save the token or the language, and with Reload.Prefer: return=minimal and no If-None-Match: every read goes with cache: no-store.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.
A generic Python client, standard library only: iteration over pages, typed values, one exception per error code, async with httpx.