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
| Page | What it is |
|---|---|
| Conventions | REST maturity level 2, RFC 7807 errors, status-code semantics, Location headers |
| Endpoint catalogue | Every route, grouped by OpenAPI tag, cross-checked against the router |
| Drawing the warehouse | The two headline read endpoints, with real JSON and real SVG output |
| Bulk import | POST /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 URL | http://localhost:8080 |
| Request bodies | application/json |
| Success responses | application/json, except GET /sites/{siteCode}/layout?format=svg which returns image/svg+xml |
| Error responses | application/problem+json (RFC 7807), on every error, from day one |
| Authentication | none — this is an internal platform service; security: [] in the specification |
The shape of the API in one glance
Endpoint count
| Group | Paths | Operations |
|---|---|---|
| Sites | 3 | 5 |
| Zones | 2 | 3 |
| Aisles | 4 | 6 |
| Location Types | 2 | 3 |
| Placement Rules | 2 | 3 |
| Locations | 6 | 6 |
| Layout | 6 | 7 |
| Health | 2 | 2 |
| Total | 27 | 35 |
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.