feat: add bulk callback and async support for patch.schemas#3415
feat: add bulk callback and async support for patch.schemas#3415
Conversation
|
|
🦋 Changeset detectedLatest commit: e494f4d The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Updated type definition to allow function signature in addition to Record - Implemented bulk callback for OpenAPI v3 schemas - Implemented bulk callback for OpenAPI v2 (swagger) definitions - Added comprehensive tests for both v2 and v3 specs - Tests cover basic callbacks, mutations, version extraction, and invalid schema handling Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
- Updated type definition to allow Promise<void> return type for both Record and bulk callback - Updated implementation to await all schema callback invocations (v2 and v3) - Added comprehensive tests for async bulk callbacks and async Record-based callbacks - Verified with manual CLI test that async operations work correctly Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
|
Leaping into action... |
@hey-api/codegen-core
@hey-api/json-schema-ref-parser
@hey-api/nuxt
@hey-api/openapi-ts
@hey-api/shared
@hey-api/types
@hey-api/vite-plugin
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3415 +/- ##
==========================================
+ Coverage 38.93% 38.96% +0.03%
==========================================
Files 473 473
Lines 17292 17302 +10
Branches 5218 5218
==========================================
+ Hits 6732 6742 +10
Misses 8480 8480
Partials 2080 2080
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|

Large OpenAPI specs (e.g., DMTF Redfish with 1600+ schemas) require name-based transformations across all schemas. Current API forces explicit enumeration, which is impractical at scale.
Changes
patch.schemasto accept eitherRecord<string, fn>(existing) or(name, schema) => void | Promise<void>(new bulk callback)definitions) and v3 (components.schemas). All callbacks now properly awaited.Usage
Backward compatible with existing Record-based usage.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.