Skip to content

fix(openapi-typescript): handle readonly arrays in ReadonlyArray helper#2749

Open
y-hsgw wants to merge 1 commit intoopenapi-ts:mainfrom
y-hsgw:fix/readonly-array-detection
Open

fix(openapi-typescript): handle readonly arrays in ReadonlyArray helper#2749
y-hsgw wants to merge 1 commit intoopenapi-ts:mainfrom
y-hsgw:fix/readonly-array-detection

Conversation

@y-hsgw
Copy link
Copy Markdown

@y-hsgw y-hsgw commented Apr 9, 2026

Changes

This PR updates the ReadonlyArray<T> helper used by openapi-typescript so it recognizes readonly unknown[] in addition to mutable arrays.

Fixes: #2714

How to Review

Check packages/openapi-typescript/src/lib/ts.ts to confirm the array guard now uses readonly unknown[].

The snapshot updates in packages/openapi-typescript/test/node-api.test.ts reflect the generated output change and should match the new helper behavior.

Checklist

  • Unit tests updated
  • docs/ updated (if necessary)
  • pnpm run update:examples run (only applicable for openapi-typescript)

@y-hsgw y-hsgw requested a review from a team as a code owner April 9, 2026 13:13
@y-hsgw y-hsgw requested a review from drwpow April 9, 2026 13:13
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 9, 2026

👷 Deploy request for openapi-ts pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ca0585e

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 9, 2026

⚠️ No Changeset found

Latest commit: ca0585e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

enumValues + immutable generates broken FlattenedDeepRequired for readonly arrays

1 participant