Skip to content

fix(API): extract cldr_version enum to fix TypeScript client build - #1223

Merged
Franca Winter (francawinter) merged 4 commits into
mainfrom
claude/fix-icu-cldr-version-typescript
Jul 23, 2026
Merged

fix(API): extract cldr_version enum to fix TypeScript client build#1223
Franca Winter (francawinter) merged 4 commits into
mainfrom
claude/fix-icu-cldr-version-typescript

Conversation

@francawinter

@francawinter Franca Winter (francawinter) commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What changed

Removed the enum constraint from cldr_version in the POST /icu/skeleton request body.

Why

The typescript-fetch generator has a bug: inline string enums inside schemas that also use oneOf emit a property type reference without the matching enum declaration, causing a TypeScript compile error in the generated client:

src/models/IcuSkeletonParameters.ts: Cannot find name 'IcuSkeletonParametersCldrVersionEnum'

Removing the enum fixes the build. The description and example are updated to reflect the actual accepted values (legacy or a CLDR version string such as cldr48).

Steps to verify

CI jest / Run Typescript Tests should pass.

The typescript-fetch generator fails to emit the enum declaration for
inline string enums inside schemas that also use oneOf. This causes a
compile error in the generated client:

  src/models/IcuSkeletonParameters.ts: Cannot find name
  'IcuSkeletonParametersCldrVersionEnum'

Fix: extract cldr_version to a named component schema
(icu_skeleton_cldr_version). The generator handles named schemas
correctly. Enum values are unchanged so this is not a breaking change.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

API changelog (oasdiff)

Doc-only edits (descriptions, examples) do not appear here.

2 changes: 2 error, 0 warning, 0 info
error	[request-property-enum-value-removed] at doc/compiled.json
	in API POST /icu/skeleton
		removed the enum value `cldr_41` of the request property `cldr_version`

error	[request-property-enum-value-removed] at doc/compiled.json
	in API POST /icu/skeleton
		removed the enum value `legacy` of the request property `cldr_version`

Franca Winter (francawinter) added a commit that referenced this pull request Jul 23, 2026
The TypeScript generator fix for the icu/skeleton endpoint is unrelated
to the format annotations endpoint. Extracted to its own PR.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread schemas/icu.yaml Outdated
type: string
description: >-
Pluralization rule set to apply when constructing skeletons.
Accepted values are `legacy` and `cldr_41`. Defaults to

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure whether that's correct that only cldr 41 and legacy are accepted

The enum was wrong (cldr_41 should be cldr41) and would go stale with
every CLDR release. Drop it in favour of a description that names
legacy and cldr48 as representative values without pinning an exhaustive
list. Update example to cldr48 (current default).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The typescript-fetch generator fails to emit the enum declaration for
inline string enums inside schemas that also use oneOf, causing a
compile error in the generated TypeScript client. Removing the enum
fixes the build. Description and example updated to reflect the actual
accepted values.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@francawinter Franca Winter (francawinter) added the breaking-change-approved Skip the oasdiff breaking-change gate: this PR intentionally changes the API surface label Jul 23, 2026
@francawinter
Franca Winter (francawinter) marked this pull request as ready for review July 23, 2026 11:55
@francawinter
Franca Winter (francawinter) merged commit 9a3aa7f into main Jul 23, 2026
13 of 14 checks passed
@francawinter
Franca Winter (francawinter) deleted the claude/fix-icu-cldr-version-typescript branch July 23, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change-approved Skip the oasdiff breaking-change gate: this PR intentionally changes the API surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants