Documentation previewThese docs are actively being built. Some pages may change as the framework and examples are finalized.
Skip to content

API Index

The API Index is generated metadata about the App's HTTP API surface.

GoForj generates it during build and run workflows so route visibility, diagnostics, and OpenAPI output stay close to the current source.

Build Outputs

The default generated outputs are:

text
build/api_index.json
build/api_index.diagnostics.json
build/openapi.json

The API index is generated by the build pipeline through the webindex package from Web.

When It Runs

forj build runs:

  1. generated component refresh
  2. Wire generation
  3. API indexing
  4. go build

The development command surface also runs generation and API indexing before delegated App commands. forj run <command> uses the same source-aware path explicitly.

What It Is Good For

The API Index helps with:

  • route metadata
  • operation discovery
  • generated diagnostics
  • OpenAPI generation
  • local API inspection
  • keeping Swagger output current

Current Limits

API indexing is source-based and generated from the App's code shape.

It is useful for conventional GoForj route/controller patterns, but it should not be treated as a full runtime recorder of every possible dynamic behavior. If route registration or response shape is intentionally dynamic, document that behavior explicitly.

Common Mistakes

Common mistakes

  • Do not hand-edit generated API index output.
  • Do not assume API indexing replaces route tests.
  • Do not hide important routes behind dynamic registration when static route visibility matters.
  • Do not treat diagnostics as noise; they usually explain why metadata could not be inferred.

Next Steps