fix(transformers): respect additionalProperties when generating object map transforms by codercms · Pull Request #3409 · hey-api/openapi-ts

Conversation

@codercms

  • transformers plugin now handles additionalProperties in object schemas
  • Applies transforms to map values from additionalProperties while skipping declared properties
  • Adds regression test fixture for transformers-additional-properties

P.S. Generated code could be improved by using something like:

for (const key of Object.keys(data) {
     data[key] = transformFn(data[key]);
}

But I didn't found a for-loop builder

…t map transforms

* `transformers` plugin now handles `additionalProperties` in object schemas
* Applies transforms to map values from `additionalProperties` while skipping declared properties
* Adds regression test fixture for `transformers-additional-properties`

@bolt-new-by-stackblitz

@vercel

@changeset-bot

@dosubot dosubot bot added size:XXL

This PR changes 1000+ lines, ignoring generated files.

bug 🔥

Broken or incorrect behavior.

labels

Feb 17, 2026

@codecov

Codecov Report

❌ Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.88%. Comparing base (5ae69ba) to head (4de44fc).
⚠️ Report is 292 commits behind head on main.

Files with missing lines Patch % Lines
...api-ts/src/plugins/@hey-api/transformers/plugin.ts 0.00% 8 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3409      +/-   ##
==========================================
- Coverage   38.91%   38.88%   -0.03%     
==========================================
  Files         473      473              
  Lines       17287    17299      +12     
  Branches     5210     5214       +4     
==========================================
  Hits         6727     6727              
- Misses       8480     8488       +8     
- Partials     2080     2084       +4     
Flag Coverage Δ
unittests 38.88% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new

Open in StackBlitz

@hey-api/codegen-core
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/codegen-core@3409
@hey-api/json-schema-ref-parser
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/json-schema-ref-parser@3409
@hey-api/nuxt
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/nuxt@3409
@hey-api/openapi-ts
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/openapi-ts@3409
@hey-api/shared
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/shared@3409
@hey-api/types
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/types@3409
@hey-api/vite-plugin
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/vite-plugin@3409

commit: 4de44fc

Labels

bug 🔥

Broken or incorrect behavior.

size:XXL

This PR changes 1000+ lines, ignoring generated files.

1 participant

@codercms