@voxgig/apidef 8.3.0 → 8.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.ts CHANGED
@@ -253,6 +253,25 @@ type GuideMetrics = {
253
253
 
254
254
 
255
255
  type GuideEntity = {
256
+ // COMPOSITE IDENTITY CORRECTION, the guide's say over how an entity is
257
+ // addressed. apidef infers a compound key from adjacent path parameters,
258
+ // which is right far more often than not and cannot always be right:
259
+ // `/…/artifacts/{artifact_id}/{archive_format}` reads as composite and is
260
+ // not. Stating it here is the documented correction surface (ADR-002).
261
+ //
262
+ // `parts` names the compound key outright; `composite: false` says these
263
+ // adjacent parameters are not one (the record still has a key); `sep`
264
+ // changes the separator without restating the parts.
265
+ id?: {
266
+ parts?: string[]
267
+ sep?: string
268
+ composite?: boolean
269
+ // Corrects WHERE A PART LIVES in a response, per part, so a spec can fix
270
+ // one mapping without restating the others — the heuristic gets most of
271
+ // them right and the odd one wrong.
272
+ from?: Record<string, string>
273
+ }
274
+
256
275
  name: string
257
276
  orig: string
258
277
  // `false` drops the entity downstream (transform/entity.ts). Emitted by