Skip to main content

Overview

The docs UI route (/docs/api by default) can be rendered by three built-in renderers. All of them load the same OpenAPI document from the JSON route of the current API. Pick one with geni.renderer:
config/geni.php

Per-API Renderer

Each entry of geni.apis can choose its own renderer. APIs without a renderer key use the global geni.renderer:
config/geni.php

Built-in Portal (blade)

The default renderer is a standalone Blade, Tailwind and Alpine.js portal with live search, syntax highlighting, the interactive version switcher and a Try It console.
config/geni.php
  • The Tailwind Play CDN and Alpine.js URLs are pinned. The docs login page uses the same URLs.
  • custom_css is injected into the page’s <style> element; it cannot close that element.

API Overview

When the URL has no endpoint hash, the portal opens on an API overview showing the title, version and info.description of the document. Clicking the API title in the sidebar returns to it. Multi-line descriptions keep their line breaks.

Markdown Descriptions

The API overview, operation descriptions and response descriptions are rendered as Markdown by a small, escaping-first renderer. It supports:
  • Paragraphs and headings
  • Bulleted and numbered lists
  • Fenced code blocks and inline code
  • Bold and italic
  • Links with http(s) or relative URLs
Raw HTML is never interpreted; it is shown as text. See PHPDoc Annotations for how descriptions are read from docblocks.

Scalar (scalar)

config/geni.php
  • By default Geni loads https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.72.3/dist/browser/standalone.js.
  • configuration is passed to Scalar.createApiReference() as-is (for example theme, layout, hideModels). Geni sets url to the current API’s JSON route and theme to laravel unless you override it.

Stoplight Elements (elements)

config/geni.php
By default Geni loads the pinned @stoplight/elements@9.0.25 build from jsDelivr:
  • Script: https://cdn.jsdelivr.net/npm/@stoplight/elements@9.0.25/web-components.min.js
  • Stylesheet: https://cdn.jsdelivr.net/npm/@stoplight/elements@9.0.25/styles.min.css

Self-Hosting Assets

Scalar and Elements load pinned CDN builds. To serve them from your own domain (for example under a strict Content Security Policy), download the files and point script_url (and stylesheet_url for Elements) at your copies:
config/geni.php

Custom Renderers

geni.renderer (or an API’s renderer) may also be a class name implementing Geni\Laravel\Renderer:
An unknown value falls back to the blade renderer.
Renderers only change the UI. Access rules (restrict_to_local, the viewApiDocs gate, docs_auth) apply to every renderer. See Documentation Authentication.