Skip to content

fix(openapi-fetch): reject excess request body and params properties #2679

Draft
F3n67u wants to merge 1 commit intoopenapi-ts:mainfrom
F3n67u:fix-1769
Draft

fix(openapi-fetch): reject excess request body and params properties #2679
F3n67u wants to merge 1 commit intoopenapi-ts:mainfrom
F3n67u:fix-1769

Conversation

@F3n67u
Copy link

@F3n67u F3n67u commented Mar 13, 2026

Changes

Fixes #1769 in openapi-fetch.

This changes openapi-fetch's request typing so excess properties are rejected consistently for body and params, while preserving parseAs inference. It also moves the new regression coverage into dedicated *.test-d.ts type tests and adds the missing query array params to the shared common.yaml fixture used by params tests.

How to Review

Review packages/openapi-fetch/src/index.d.ts first to verify the parseAs typing now flows through a dedicated generic instead of the full inferred Init object.

Then review the new type tests:

  • packages/openapi-fetch/test/http-methods/post.test-d.ts
  • packages/openapi-fetch/test/http-methods/request.test-d.ts
  • packages/openapi-fetch/test/path-based-client/path-based-client.test-d.ts
  • packages/openapi-fetch/test/common/params.test-d.ts

Checklist

  • Unit tests updated
  • docs/ updated (not needed)
  • pnpm run update:examples run (not applicable)

@netlify
Copy link

netlify bot commented Mar 13, 2026

👷 Deploy request for openapi-ts pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit fd3bdb6

@changeset-bot
Copy link

changeset-bot bot commented Mar 13, 2026

🦋 Changeset detected

Latest commit: fd3bdb6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
openapi-fetch Patch
openapi-react-query Patch

Not sure what this means? Click here to learn what changesets are.

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

@F3n67u F3n67u force-pushed the fix-1769 branch 3 times, most recently from 63eaec9 to 8898518 Compare March 14, 2026 19:59
@F3n67u F3n67u changed the title fix: tighten openapi-fetch excess property checks fix(openapi-fetch): reject excess request body and params properties Mar 14, 2026
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.

Undefined properties on body object are not flagged if required fields are filled in

1 participant