new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Hono · all subjects

out of scope

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Hono Docs tool for auto-generating OpenAPI specs

Hono Docs is a third-party tool that auto-generates OpenAPI 3.0 spec and TypeScript type snapshots from Hono route type definitions. It provides automated OpenAPI documentation generation for Hono APIs.

Create hono-docs.ts config file with defineConfig

Create a configuration file named hono-docs.ts at the root of your project using defineConfig from '@rcmade/hono-docs'. The config includes tsConfigPath (path to tsconfig.json), openApi object with openapi version, info with title and version, servers array, outputs object with openApiJson path, and apis array defining route groups.

Hono Docs config structure for APIs

Each API group in the apis array must have: name (string), apiPrefix (string to prepend to routes), appTypePath (path to AppType export), and api array. Each api entry contains: api (route path with placeholders like {id}), method (HTTP method), summary (optional title), description (optional), and tag (optional array of strings for grouping).

Export AppType from route files for Hono Docs

Route files must export a type called AppType as typeof the routes variable. Example: export type AppType = typeof userRoutes where userRoutes is a Hono() instance with defined routes. This is required for the Hono Docs library to introspect routes.

Generate OpenAPI spec with Hono Docs CLI

Run npx @rcmade/hono-docs generate --config ./hono-docs.ts to generate the OpenAPI specification from the configuration file. The --config flag specifies the path to the hono-docs.ts file (defaults to root/hono-docs.ts).

Scalar integration for Hono Docs API reference UI

Use @scalar/hono-api-reference Scalar component to display generated docs. Configure with url (path to OpenAPI JSON), theme (e.g. 'kepler'), layout (e.g. 'modern'), and defaultHttpClient object with targetKey and clientKey properties. Serve OpenAPI JSON from a separate endpoint and visit /docs to show the UI.

Give your agent this brain