Skip to main content

API Reference

facility-layout exposes one HTTP API, documented here. Its message-broker interface — the Published Language on the warehouse.facility.events Kafka topic — is specified in apis/asyncapi.yaml (AsyncAPI 2.6.0) and described on Domain events; it has no generated page in this section.

How this section is organised​

PageWhat it is
ConventionsREST maturity level 2, RFC 7807 errors, status-code semantics, Location headers
Endpoint catalogueEvery route, grouped by OpenAPI tag, cross-checked against the router
Drawing the warehouseThe two headline read endpoints, with real JSON and real SVG output
Bulk importPOST /location-imports and the partial-success report
REST API (from openapi.yaml)The interactive, per-operation reference generated from the real specification — request/response schemas, examples, and a try-it console
Reports API (from openapi-reports.yaml)The analytical read API served by the separate cmd/facility-reports binary (/reports/catalog-growth, /reports/catalog-growth/freshness, probes), generated from apis/openapi-reports.yaml

The generated reference is the source of truth​

The pages under REST API (from openapi.yaml) are generated at build time by docusaurus-plugin-openapi-docs directly from apis/openapi.yaml in this repository — the same ~3,300-line OpenAPI 3.0.3 document that is linted in CI:

spectral lint apis/openapi.yaml --ruleset .spectral.yaml --fail-severity=warn

Nothing in that section is hand-transcribed, so it cannot drift from the specification. The hand-written pages in this section exist to explain shape and intent — the things a schema cannot say.

Base URL and content types​

Local base URLhttp://localhost:8080
Request bodiesapplication/json
Success responsesapplication/json, except GET /sites/{siteCode}/layout?format=svg which returns image/svg+xml
Error responsesapplication/problem+json (RFC 7807), on every error, from day one
Authenticationnone — this is an internal platform service; security: [] in the specification

The shape of the API in one glance​

Endpoint count​

GroupPathsOperations
Sites35
Zones23
Aisles46
Location Types23
Placement Rules23
Locations66
Layout67
Health22
Total2735

Every one of the 35 operations the router mounts — including the /healthz and /readyz probes — has a matching operation, at the same path, in apis/openapi.yaml. The per-route breakdown is on the Endpoint catalogue page.

The reports binary (cmd/facility-reports) is not in that count. Its four operations (GET /reports/catalog-growth, GET /reports/catalog-growth/freshness, /healthz, /readyz) are in apis/openapi-reports.yaml, and internal/adapters/inbound/http/reports_contract_test.go fails if the spec and NewReportsRouter disagree.