Renders an interactive API documentation browser showing all webhooks matching a filter, with sidebar navigation, per-endpoint accordion sections, Mermaid sequence diagrams, and PDF export.
Class: Report in factory.report/package.system/ObjReportApi.py
Inherits from: ObjReportDocumentation.Report (not ObjData directly)
Companion YAML: ObjReportApi.yaml
ObjReportApi is a concrete subclass of ObjReportDocumentation. It
does not define its own Render() method -- it inherits the base
class layout, sidebar, panel structure, and PDF export. The
subclass implements the three-method contract (build_pages,
get_title, get_subtitle) to produce webhook-specific content.
| Field | Value |
|---|---|
ReportCode |
DEMO_API |
ReportType |
Api |
Module |
Api |
Template |
DEMO |
Package |
REFERENCE |
get_title() -> strReturns "API Documentation".
get_subtitle(param1, param2) -> strReturns a subtitle with the active package name.
build_pages(param1, param2, param3) -> list[dict]Queries def_webhook filtered by param1 (applied to
WebhookCode and ServiceCode). For each matching webhook,
builds a page dict with sections assembled from the private
builder methods listed below.
The page content for each webhook is split into focused private
methods:
| Method | Section Content |
|---|---|
_build_overview(webhook) |
Description, company, version, terms, notes |
_build_auth(webhook) |
Authentication type and credential details |
_build_endpoint_details(webhook) |
URL, method, content type, rate limits |
_build_mermaid(webhook_code, method) |
Sequence diagram (Client -> API -> Server) |
_build_parameters(webhook_code) |
Parameter table from def_webhook_parameters |
_build_samples(webhook) |
Request/response sample payloads |
_build_test_card(webhook) |
Interactive test runner card |
_build_validations(webhook_code) |
Validation rules from def_webhook_validations |
_build_return_codes(webhook_code) |
HTTP status codes from list_webhook_status |
The subclass defines convenience wrappers that delegate to the base
class render methods:
| ObjReportApi method | Delegates to |
|---|---|
render_card(title, icon, content, color) |
render_section() |
render_table_simple(headers, rows) |
render_table() |
render_highlight_block(content, lang) |
render_code_block() |
ObjReportApi.yaml contains only webhook-specific JavaScript:
HTML templates and CSS are inherited from
ObjReportDocumentation.yaml via YAML MRO merging. The subclass
YAML does not need to duplicate any base resources.
PatchHook(notes: str)Replaces template placeholders ($apiuser$, $apipassword$,
$apisession$, $apiurl$) in a notes string with live credential
values.
| Table | Purpose |
|---|---|
def_webhook |
Webhook definitions (code, URL, method, auth) |
def_webhook_parameters |
Per-webhook parameter definitions |
def_webhook_validations |
Per-webhook validation rules |
list_webhook_status |
HTTP return code descriptions |
Six demo webhooks are seeded in referencedb.axion for testing:
| WebhookCode | Description |
|---|---|
DEMO_USER_CREATE |
Create user account |
DEMO_ORDER_STATUS |
Query order status |
DEMO_PAYMENT_PROCESS |
Process payment |
DEMO_INVENTORY_SYNC |
Sync inventory data |
DEMO_CUSTOMER_DELETE |
Delete customer record |
DEMO_NOTIFICATION_SEND |
Send notification |
generateDocPDF() function.def_webhook, def_webhook_parameters,def_webhook_validations, and list_webhook_status.