feat(openapi): describe the catalog read endpoints (browse + sync)#5790
Merged
Conversation
Completes the property-catalog OpenAPI surface started in #5787. The catalog read/consume endpoints are live but were absent from static/openapi/registry.yaml, so the SDK's read-side (browseCatalog/syncCatalog — the second half of the resolve→sync→build-lists loop from RFC #5782) couldn't be typed. - browseCatalog — GET /api/registry/catalog: filtered, cursor-paginated browse; each entry carries the property's identifiers. - syncCatalog — GET /api/registry/catalog/sync: delta since a `server_timestamp` watermark (capped 10,000/page), distinct from browse's opaque cursor. Schemas mirror the route handlers + catalog-db result types (browse entries carry identifiers[]; sync entries are raw CatalogProperty with timestamps). property_rid documented as a non-authoritative handle, consistent with #5787. Once published, adcp-client regenerates types and adds browseCatalog()/ syncCatalog() alongside the shipped resolveIdentifiers/fileCatalogDispute/ claim/verify surface (@adcp/sdk 9.7.0). No behavior change — documentation of live endpoints only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Contributor
There was a problem hiding this comment.
Clean documentation of two live endpoints. Right shape: browse and sync are genuinely different pagination mechanisms (opaque keyset cursor vs. monotonic watermark), and documenting them as distinct rather than forcing one abstraction is correct.
Things I checked
- Browse schema mirrors the handler.
CatalogBrowseEntry(property_rid,property_id,classification,source,status,identifiers[]) matches the object built atcatalog-api.ts:210-217exactly;identifiersreusesCatalogIdentifier{type,value}, matching the{ type: i.identifier_type, value: i.identifier_value }projection at L216. Response{entries, total, next_cursor}matcheslistProperties(catalog-db.ts:393-397). All 9 query params are optional and match thereq.query.*reads. - Sync schema mirrors
CatalogPropertyfield-for-field. All 10 columns present with correct nullability (property_id,adagents_url,created_bynullable; rest required), matching the interface atcatalog-db.ts:19-30and theSELECT *at L406. All 10 in the required array — sound, since NOT NULL guarantees presence. - Timestamps typed
string.created_at/updated_at/source_updated_atareDatein TS but pg +res.jsonserialize to ISO strings;z.string()is the on-the-wire shape. Correct. sincemarkedrequired: true— handler 400s when absent (catalog-api.ts:237-239), and the schema wires that 400 toErrorSchema({error: string}). Fail-closed on the required watermark.- Generated yaml is consistent with the
.ts— field order, nullability, required arrays, examples all match.test:openapigates any drift. property_ridframing — "non-authoritative join/match handle, never an authorization credential" is verbatim-consistent with the #5787 baseline.ad-tech-protocol-expert: sound-with-caveats, no spec drift, operationIds SDK-safe.- No changeset expected: this edits server-internal OpenAPI source plus its generated artifact — not
static/schemas/source/**,docs/reference/**, or a spec-package build script.
Follow-ups (non-blocking — file as issues)
min_resolvesandactive_sinceare documented but no-ops.listProperties(catalog-db.ts:330-398) never readsfilters.min_resolvesorfilters.active_since— the handler passes them through, so the doc is faithful to the handler, but the DB layer ignores them. Documenting a param that does nothing will mislead SDK users. Either wire them up or drop them from the surface.- Sync pagination is dual, not watermark-only.
syncPropertiesreturns bothserver_timestampand anext_cursor(the last row'sproperty_rid, set when a page fills —catalog-db.ts:414). ThesyncCatalogdescription says pagination is "by the returnedserver_timestampwatermark," which undersellsnext_cursor: asincewindow exceeding 10,000 rows must page via the cursor, withORDER BY updated_at, property_ridimplying watermark-advances-window / cursor-tiebreaks-within. The schema correctly declares both required, so the contract is right — only the prose is imprecise. One-line clarification would close it.
LGTM. Follow-ups noted below.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the property-catalog OpenAPI surface started in #5787 — the read/consume side of the "send us facts" loop (resolve → sync locally → build lists), from RFC #5782.
Problem
GET /api/registry/catalogand/catalog/syncare live but were absent fromstatic/openapi/registry.yaml, so the SDK'sbrowseCatalog/syncCatalog(the only pieces of #5782 not yet in@adcp/sdk9.7.0) couldn't be typed.Change (documentation of live endpoints — no behavior change)
browseCatalog—GET /api/registry/catalog: filtered, cursor-paginated browse; each entry carries the property'sidentifiers[].syncCatalog—GET /api/registry/catalog/sync: delta since aserver_timestampwatermark (capped 10,000/page) — a different pagination mechanism from browse's opaque cursor, documented as such.catalog-dbresult types exactly (browse entries includeidentifiers[]; sync entries are rawCatalogPropertywith timestamps).property_riddocumented as a non-authoritative handle, per feat(openapi): describe the property-catalog fact-contribution endpoints #5787.Where it fits
Closes the loop after 9.7.0, which shipped the write surface (
resolveIdentifiers,fileCatalogDispute/getCatalogDispute,claim/verify,saveProperty). Once this publishes,adcp-clientregenerates types and addsbrowseCatalog()/syncCatalog()— then the full RFC #5782 surface is real end-to-end.🤖 Generated with Claude Code