Skip to content

Rename SCREAMING_SNAKE schema artifacts that surface as public TypeScript types #3145

Description

@bokelley

Context

Two source-schema patterns leak into the TypeScript SDK's public type surface as awkward, typo-feeling names. Both originate in schemas/cache/{version}/ and propagate through json-schema-to-typescript into @adcp/client's core.generated.ts and (via adcp-client#938 / #931) into the public Values exports.

Tracked SDK-side in adcp-client#942.

1. SCREAMING_SNAKE parent names

A discriminator branch with code: \"RATE_LIMITED\" and no explicit title lands as RATE_LIMITEDDetails in the generated TypeScript. PR #938 then propagates it as RATE_LIMITEDDetails_ScopeValues. Reads as a typo to every consumer.

2. Numbered-dupe suffixes from re-referenced enums

When the same enum is reachable through two different schema paths without a shared $ref, json-schema-to-typescript emits both copies as Foo and Foo1. Currently visible: AgeVerificationMethod + AgeVerificationMethod1, plus BriefAsset1, VASTAsset1, DAASTAsset1, CatalogAsset1. Both copies always have identical literal values — the suffix implies a version/distinction that doesn't exist. Documented as a known codegen artifact in the SDK's auto-memory (project_jsts_numbered_dupes.md).

Suggested fix (upstream)

In schemas/cache/{version}/:

  1. Give the RATE_LIMITED discriminator branch (and any siblings using SCREAMING_SNAKE codes) an explicit \"title\": \"RateLimitedDetails\" so json-schema-to-typescript produces RateLimitedDetails.
  2. For cross-referenced enums (AgeVerificationMethod and the four *Asset1 cases), introduce a single shared $ref so the codegen emits one type. Eliminates the dedup-by-value problem at the source.

SDK-side fallback: rename in a post-codegen step, with aliases for one minor version. Adds codegen complexity; the spec is the authoritative place to express both fixes.

Acceptance

  • RATE_LIMITEDDetailsRateLimitedDetails (or equivalent PascalCase) in the SDK's core.generated.ts after npm run sync-schemas
  • AgeVerificationMethod1, BriefAsset1, VASTAsset1, DAASTAsset1, CatalogAsset1 consolidate into the un-suffixed names
  • No consumer-facing breakage in the SDK's Values exports — released names with the suffixes get aliases for one minor version

Refs

🤖 Filed by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    claude-triagedIssue has been triaged by the Claude Code triage routine. Remove to re-triage.enhancementNew feature or requestschemaJSON Schema source-of-truth: definitions, codegen artifacts, validation, hygiene

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions