Response Documentation System
AI-generated per-endpoint field tables, success/error response examples, and badge-rich descriptions — all source-aware when a repo is connected.
What gets generated
Every endpoint can have a _responseDocs object with three sections:
- Fields table — every request field/parameter with name, type, badges, description, validation rules.
- Success response — status code + example JSON (syntax-highlighted).
- Error response — status code + example JSON.
Type badges
Each field's type is colour-coded for instant scanning:
| Type | Colour |
|---|---|
| string | blue |
| integer / number | green |
| boolean | yellow |
| array / object | purple |
| file | orange |
| date | cyan |
| purple | |
| morph_type / morph_id | pink (polymorphic) |
Info badges
- required · optional · nullable · enum · cast · polymorphic · default value
- Nested objects via dot-notation:
address.street,items.*.name. - Polymorphic relations link
morph_type+morph_idtogether visually.
Description badge colorization
Description text is parsed and inline-badge-rendered: required, nullable, unique, file, min:N, max:N, enum value lists (type: cash, bank_transfer → individual purple chips), file-extension lists (pdf, jpeg, png → blue badge), and the if new pattern → purple.
Generation modes
- Single endpoint — right-click any endpoint → Generate / Re-sync docs.
- Bulk sync all — runs in the background with a real-time progress bar (current / total %), cancelable mid-run.
- Source-aware — when a repo is connected, the agent reads the actual controller and Resource classes before writing docs, so the output matches the real response shape.
Doc statistics
The cluster header shows a live counter: X documented / Y total endpoints. Aim for 100 % before sharing publicly.