-
-
Notifications
You must be signed in to change notification settings - Fork 272
Fix(transformer): Fix readWrite transformer splitting logic #2530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix(transformer): Fix readWrite transformer splitting logic #2530
Conversation
|
|
🦋 Changeset detectedLatest commit: 7a8b34a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2530 +/- ##
==========================================
+ Coverage 23.76% 23.82% +0.05%
==========================================
Files 360 361 +1
Lines 36002 36042 +40
Branches 1539 1558 +19
==========================================
+ Hits 8557 8587 +30
- Misses 27432 27442 +10
Partials 13 13
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:
|
commit: |
...ges/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/types.gen.ts
Outdated
Show resolved
Hide resolved
- Implement a deepEqual function in readWrite.ts to deeply check if a type needs splitting - Simplify if block in readWrite.ts - Adjust tests to match the new output
|
This PR is finished, waiting for #2529 to be merged |
mrlubos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now this looks good!
| * Deep equality for JSON-compatible values (objects, arrays, primitives). | ||
| * Used to determine whether read/write pruned variants actually differ. | ||
| */ | ||
| const deepEqual = (a: unknown, b: unknown): boolean => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be better moved to a more generic utils module, seems useful
…y-or-writeOnly-properties
…d comprehensive tests
| export const ModelWithPropertiesWritableSchema = { | ||
| description: 'This is a model with one nested property', | ||
| type: 'object', | ||
| required: ['required', 'requiredAndReadOnly'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@carson2222 I think there's one more thing. If we strip a property, we want to make sure it's removed from the required array. Notice how requiredAndReadOnly is left here but gone from properties. I worry this could cause downstream issues
fix #2370