这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@carson2222
Copy link
Contributor

fix #2370

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@changeset-bot
Copy link

changeset-bot bot commented Aug 27, 2025

🦋 Changeset detected

Latest commit: 7a8b34a

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

This PR includes changesets to release 1 package
Name Type
@hey-api/openapi-ts 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

@vercel
Copy link

vercel bot commented Aug 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
hey-api-docs Ready Ready Preview Comment Aug 28, 2025 0:38am

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. bug 🔥 Something isn't working labels Aug 27, 2025
@codecov
Copy link

codecov bot commented Aug 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 23.82%. Comparing base (2204900) to head (7a8b34a).
⚠️ Report is 10 commits behind head on main.

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              
Flag Coverage Δ
unittests 23.82% <ø> (+0.05%) ⬆️

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
Copy link

pkg-pr-new bot commented Aug 27, 2025

Open in StackBlitz

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/nuxt@2530
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/openapi-ts@2530
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/vite-plugin@2530

commit: 7a8b34a

@carson2222 carson2222 requested a review from mrlubos August 27, 2025 08:36
- 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
@carson2222 carson2222 marked this pull request as ready for review August 28, 2025 09:34
@carson2222
Copy link
Contributor Author

This PR is finished, waiting for #2529 to be merged

Copy link
Member

@mrlubos mrlubos left a 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 => {
Copy link
Member

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

export const ModelWithPropertiesWritableSchema = {
description: 'This is a model with one nested property',
type: 'object',
required: ['required', 'requiredAndReadOnly'],
Copy link
Member

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

@mrlubos mrlubos merged commit 2472e51 into main Aug 28, 2025
14 checks passed
@mrlubos mrlubos deleted the fix(transformer)--Split-schemas-with-readOnly-or-writeOnly-properties branch August 28, 2025 12:45
@github-actions github-actions bot mentioned this pull request Aug 28, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 28, 2025
@hey-api hey-api bot mentioned this pull request Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🔥 Something isn't working lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Readable/Writable types are not generated when using referenced $ref schemas

3 participants