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
feat(spec,runtime,metadata-protocol)!: one schema for both discovery producers — `capabilities` canonical, `features`/`endpoints` retired, `scoping` declared (#4828)
8
+
9
+
`/discovery` is a machine-readable surface, but nothing compared what the two
10
+
producers emit against what `packages/spec` declares. The only schema the
11
+
protocol layer referenced was `GetDiscoveryResponseSchema` —
12
+
`DiscoverySchema.partial().required({version}).extend({apiName})` — so
13
+
`.partial()` hid every missing REQUIRED key while zod's default unknown-key
14
+
strip hid every UNDECLARED emitted one. The two producers then drifted in
15
+
opposite directions through the same blind spot.
16
+
17
+
`DiscoverySchema` is now authoritative for producers, and each producer package
18
+
carries a `discovery-schema-conformance.test.ts` that parses its LIVE shape
19
+
against it and checks its emitted key set against the protocol schema's shape.
20
+
21
+
**Breaking for anyone reading the dispatcher's `/.well-known/objectstack` body:**
22
+
23
+
-`features` → **`capabilities`**, the name `DiscoverySchema` has always
24
+
declared, in the declared `{ enabled }` shape. The same flags survive. This
25
+
fixes a real defect: the SDK's `client.capabilities` getter reads
26
+
`discoveryInfo.capabilities`, so against a dispatcher-served host it returned
27
+
`undefined` for every flag while the answers sat one key away under `features`.
28
+
-`endpoints` — **removed**. It duplicated `routes` verbatim as a
29
+
"backward compatibility" alias; a consumer census across `objectstack`,
30
+
`objectui` and `cloud` found no reader. Use `routes`.
31
+
-`environment` is now **mapped** into its declared enum instead of passing
32
+
`NODE_ENV` through raw (`test` → `development`, `staging` → `sandbox`,
33
+
unrecognized → `development`, never `production` on a guess). `NODE_ENV=test`
34
+
and `staging` previously advertised values outside the declared enum.
35
+
36
+
**Additive elsewhere:**
37
+
38
+
-`DiscoverySchema` declares `scoping` (optional) — the environment-scoping
39
+
posture the REST endpoint has always emitted and `packages/client` has always
40
+
consumed, now part of the contract instead of an undeclared extra.
41
+
- The REST `/discovery` body gains the required `name` / `environment` /
42
+
`locale`, so it can satisfy `DiscoverySchema` at all. `locale` is derived from
43
+
the registered i18n service, the same way the dispatcher derives it.
44
+
-`name` is canonical on both producers. `apiName` remains as a deprecated alias
45
+
carrying the identical value and is **scheduled for removal in protocol 18**.
46
+
- New exports: `DiscoveryEnvironmentSchema`, `DiscoveryEnvironment`,
0 commit comments