Declare docs next to your handlers and get a browsable, debuggable, exportable API portal. PHP, Go and Rust share one document model and one static UI.
Apidoc turns API docs from hand-written Markdown into declarations next to your code. PHP uses PHP 8 attributes, Go uses typed structs, and Rust uses proc macros. All three share one document model, live debugging and the same static front-end.
The PHP edition started from HGthecode/apidoc-php (hg/apidoc). Go, Rust and apidoc-ui are maintained by erikwang2013. Each language keeps its native setup while the documentation experience stays consistent.
From declaration to delivery, all three languages follow the same documentation pipeline.
PHP >= 8.0Go >= 1.24Rust >= 1.82MIT
Project family social preview. The pet and annotation code.
Pick your language first.
One documentation workflow, different declaration mechanisms, framework adapters and build times. Every language has its own guide.
PHPv1.0.6
PHP
Attribute-driven API docs for PHP 8
Write PHP 8 attributes in Laravel, ThinkPHP, Hyperf, Webman, Yii2 or Yii3 and get a browsable, debuggable, exportable API portal.
Declare docs as typed structs next to route registration. A built-in web UI provides browsing and live debugging for net/http, Gin, Echo, Chi, Fiber, beego, Kratos and go-zero.
Declare docs with proc macros on handlers, register them statically at compile time and aggregate at zero runtime cost. Works with axum and actix-web, with auth, Mock, exports, sharing and codegen built in.
A Vue 3 + TypeScript documentation front-end with apps/versions, live debugging, sharing, Swagger export, cache management and i18n. The build output is fully static.
One static front-end for all three backends · Vue 3.5 · Vite 6 · Pinia · Monaco
#[apidoc::title("Get user")]#[apidoc::method("GET")]#[apidoc::url("/users/{id}")]#[apidoc::route_param( name = "id", ty = "int", required)]#[apidoc::returned( name = "name", ty = "string")]asyncfnget_user(){}
One documentation experience, native in each.
Live debug, auth, exports and the shared UI follow one workflow; see each guide for exact capabilities.
Live debugging
Call real endpoints from the docs page with global params, Mock prefill and request/response events. Every language guide includes a debug panel.
200 OKsample response
{ "code": 0, "data": { "id": 1024 } }
Mock data
Field-level Mock examples. PHP supports rule expressions, Go generates values by type, and Rust ships 15 fake rules.
nickname"erik"
email"fake:email"
id1024
Apps and versions
Manage multiple apps and versions in one portal, switch by the app tree, and scope access passwords per app.
api v1admin v2open v3
Auth and caching
Global and per-app passwords, document caching, ETag/304 and constant-time comparison for speed with a security boundary.
password******
Unified exports
JSON, TypeScript, Markdown and Swagger/OpenAPI are available per language. Hand request and response shapes to front-end and QA.
JSONTypeScriptMarkdownSwagger
Code generation
PHP and Rust provide template-driven code generation; Go focuses on exports and comment parsing.
API fileHandlerSQL
Shared docs UI
apidoc-ui serves PHP, Go and Rust backends. Vue 3 + TypeScript with a fully static build.
apidoc-ui · Vue 3
Security boundary
HMAC tokens, CORS allowlists and path/identifier validation. Treat the docs server like a production API.
HMAC-SHA256CORS
From declaration to delivery
Declare, browse, debug, export and deploy on one path, shared by all three languages.
Declare→Browse→Debug→Export→Deploy
Declare
annotations next to code
Browse
docs generated automatically
Debug
live requests and Mock
Export
JSON / TS / Swagger
The usage guides are the core of this site.
Each guide covers installation, rules, complete examples, common scenarios and troubleshooting. Pick your stack, then go deep.
PHPv1.0.6
PHP Guide
Write PHP 8 attributes in Laravel, ThinkPHP, Hyperf, Webman, Yii2 or Yii3 and get a browsable, debuggable, exportable API portal.
Declare docs as typed structs next to route registration. A built-in web UI provides browsing and live debugging for net/http, Gin, Echo, Chi, Fiber, beego, Kratos and go-zero.
Install, Config and Router
Route / Doc / Param / Response
8 framework adapters
Auth, caching, exports, scenarios and troubleshooting
Declare docs with proc macros on handlers, register them statically at compile time and aggregate at zero runtime cost. Works with axum and actix-web, with auth, Mock, exports, sharing and codegen built in.
A Vue 3 + TypeScript documentation front-end with apps/versions, live debugging, sharing, Swagger export, cache management and i18n. The build output is fully static.