You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/docs/src/content/docs/openapi.mdx
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,10 @@ title: OpenAPI Spec
3
3
description: Machine-readable OpenAPI schema for the API
4
4
---
5
5
6
-
The full OpenAPI schema describes every endpoint, parameter, and response shape. Use it with code generators, Swagger/Redoc viewers, or Postman.
6
+
The OpenAPI 3.0.3 document describes every endpoint with its parameters, response envelopes, and error shape. Use it with code generators, Swagger/Redoc viewers, or Postman.
7
7
8
8
```
9
9
https://l2api.dev/api/openapi.json
10
10
```
11
+
12
+
List rows, drops, shops, hennas, and meta endpoints carry exact schemas. The large detail responses (item, NPC, quest, class, armor set, raw NPC) currently document their stable top-level fields and allow additional properties — full field-level precision for those is planned. The prose contract in the repo's `docs/api-contract.md` remains the authoritative field reference.
are **approximate**: they document the stable top-level fields and
803
+
set `additionalProperties: true` pending Phase B.
793
804
794
805
**Phase B (deferred)** — migrate the larger DTOs (`ItemDetailDto`,
795
806
`NpcDetailDto`, `QuestDetailDto`, etc.) one at a time and switch
796
807
their TypeScript types to `z.infer<typeof ...>`, making schemas the
797
808
source of truth. Each migration must pass the existing snapshot
798
809
suite without diff. Routes still don't validate at runtime.
799
810
800
-
**Phase C (deferred)** — register every route's request/response in
801
-
the OpenAPI registry and generate a complete spec. The Phase-A stub
802
-
is already published at runtime via `GET /api/openapi.json`, so
803
-
Phase C is purely about widening `components.schemas` and populating
804
-
`paths` — not about distribution.
811
+
**Phase C (deferred)** — replace the approximate detail schemas in
812
+
the spec with the exact Phase-B schemas. The document is already
813
+
published at runtime via `GET /api/openapi.json` with full path
814
+
coverage, so Phase C is purely a precision pass on
815
+
`components.schemas` — not about distribution.
805
816
806
817
The roadmap is intentionally conservative: snapshots remain the
807
818
authoritative regression detector through all three phases. A bug
@@ -856,4 +867,4 @@ and should not be pinned by external consumers:
856
867
857
868
-[`api.md`](./api.md) — external-facing API overview (endpoints, query params, examples).
858
869
-[`AGENTS.md`](../AGENTS.md) — project-wide engineering principles, scope, and out-of-scope notes.
859
-
-[`openapi.stub.json`](./openapi.stub.json) — auto-generated stub spec covering the Phase-A schemas. Regenerate with `pnpm openapi`.
870
+
-[`openapi.json`](./openapi.json) — auto-generated OpenAPI 3.0.3 spec covering every public route; detail-DTO schemas are approximate pending Phase B. Regenerate with `pnpm openapi`.
Copy file name to clipboardExpand all lines: docs/api.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,7 +133,7 @@ The same `HennaSummary` shape appears as a cross-link from item detail (`ItemDet
133
133
134
134
| Method | Path | Description |
135
135
|---|---|---|
136
-
| GET |`/api/openapi.json`| OpenAPI 3.0 document for the API. Chronicle-agnostic — the document describes `/api/{chronicle}/...` as a parameterised path, with `{chronicle}` exposed as a server-template variable. Phase A: `components.schemas` is populated for the small reusable cross-link DTOs (`NpcRef`, `ClassRef`, `QuestRef`, `RegionRef`, `LocationRef`, `EnrichedSpawn`, `QuestClientJournalEntry`, `HennaSummary`); `paths` is intentionally empty pending Phase C per-route generation (see `docs/api-contract.md`). The document is the committed `docs/openapi.stub.json` build artifact, served as a convenience without an envelope. |
136
+
| GET |`/api/openapi.json`| OpenAPI 3.0.3 document for the API. Chronicle-agnostic — every data path carries an explicit `{chronicle}` path parameter against the `/api` server root. `paths` covers every public route with its parameters and response envelopes; list/summary, drop, shop, meta, and henna schemas are exact, while the large detail schemas (`ItemDetail`, `NpcDetail`, `QuestDetail`, `ClassDetail`, `ArmorSet`, `RawNpc`) document stable top-level fields and allow additional properties pending the Phase B Zod migration (see `docs/api-contract.md`). The document is the committed `docs/openapi.json` build artifact, served as a convenience without an envelope. |
0 commit comments