Quickback Docs
Quickback for Hono API

OpenAPI Spec

Auto-generated OpenAPI 3.1 specification from your Quickback definitions.

The compiler generates an OpenAPI 3.1 specification from your feature definitions. By default it's both written to openapi.json at your project root and served as a runtime route.

Endpoint

GET /openapi.json

Returns the full OpenAPI spec as JSON.

curl https://your-api.example.com/openapi.json

What's included

The generated spec documents every route the compiler produces:

  • CRUD endpoints (list, get, create, update, delete)
  • Batch operations
  • Views
  • Actions (including standalone actions)
  • Auth routes (/api/auth/**)
  • Storage, embeddings, and webhook routes (when configured)

Each endpoint includes request/response schemas derived from your Drizzle column types, access control metadata, and error responses.

Configuration

Both generation and publishing default to true. You can control them independently in quickback.config.ts:

export default defineConfig({
  name: "my-app",
  // ...
  openapi: {
    generate: true,   // write openapi.json to project root
    publish: true,    // serve GET /openapi.json at runtime
  },
});
OptionDefaultDescription
generatetrueWrite openapi.json to the project root during compilation
publishtrueServe the spec at GET /openapi.json (requires generate: true)
docsfalseMount an interactive API browser at GET /docs"scalar", "swagger", or false

Omitting the openapi key entirely is equivalent to generate: true, publish: true, docs: false.

Generate only (no runtime route)

openapi: {
  generate: true,
  publish: false,
}

The file is still written so you can use it in CI or commit it to your repo, but no route is added to the app.

Disable entirely

openapi: {
  generate: false,
}

No file is written and no route is served.

Interactive API browser at /docs

Mount an in-browser API reference by setting openapi.docs:

openapi: {
  docs: 'scalar',   // or 'swagger'
}
ValueUINotes
"scalar"Scalar API Reference — modern, lightweightRecommended default
"swagger"Swagger UI — the familiar standardGood if your team expects it
false / unsetNo /docs routeDefault

Both UIs are loaded from CDN in a generated static HTML route — no npm package is added to your project, no Hono middleware is installed, and the runtime bundle stays the same size. The flag is purely compile-time: it toggles whether a /docs route is emitted.

Requires publish: true (the default). When publish is off, /docs is silently skipped — there's no spec for it to read.

Usage with tools

Import into Postman

  1. Open Postman and click Import
  2. Paste the URL https://your-api.example.com/openapi.json or upload the file
  3. Postman creates a collection with every endpoint pre-configured

Generated TypeScript types (api-types.gen.ts)

The compiler emits api-types.gen.ts next to openapi.json by default — a fully typed view of every route, request body, and response, ready to import in client code:

import type { paths, components } from '../api-types.gen';

type Job = components['schemas']['Job'];
type ListJobsResponse = paths['/api/v1/jobs']['get']['responses']['200']['content']['application/json'];

Pair it with openapi-fetch for a fully typed client:

import createClient from 'openapi-fetch';
import type { paths } from '../api-types.gen';

const client = createClient<paths>({ baseUrl: 'https://your-api.example.com' });
const { data, error } = await client.GET('/api/v1/jobs', { params: { query: { limit: 25 } } });

Configuration

openapi.typesBehavior
true (default)Write api-types.gen.ts to the project root
falseDon't emit the types file
"src/lib/api-types.ts"Custom output path (relative to project root)
// quickback.config.ts
export default defineConfig({
  // ...
  openapi: {
    types: 'src/lib/api-types.gen.ts',  // emit straight into your client app
  },
});

The file is generated by piping the in-memory spec through openapi-typescript — you can keep running it manually if you want a different output path or version, but for the typical case there's nothing to wire up. Skipped automatically when openapi.generate is false.

External viewer

Point any OpenAPI-compatible viewer at the endpoint:

https://petstore.swagger.io/?url=https://your-api.example.com/openapi.json

Or enable the in-project browser via the docs config option above and visit /docs directly.

Example output (excerpt)

{
  "openapi": "3.1.0",
  "info": {
    "title": "my-app API",
    "version": "1.0.0"
  },
  "paths": {
    "/api/v1/jobs": {
      "get": {
        "summary": "List jobs",
        "operationId": "listJobs",
        "parameters": [
          { "name": "limit", "in": "query", "schema": { "type": "integer" } },
          { "name": "offset", "in": "query", "schema": { "type": "integer" } }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": { "type": "array", "items": { "$ref": "#/components/schemas/Job" } }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

On this page