Skip to content

WIP: upgrade schemars#6894

Closed
arendjr wants to merge 2 commits intobiomejs:mainfrom
arendjr:upgrade-schemars
Closed

WIP: upgrade schemars#6894
arendjr wants to merge 2 commits intobiomejs:mainfrom
arendjr:upgrade-schemars

Conversation

@arendjr
Copy link
Copy Markdown
Contributor

@arendjr arendjr commented Jul 15, 2025

Summary

Attempt to upgrade to schemars 1.0, but unfortunately I got with the subschemas. If anyone has an insight, it would be appreciated!

Test Plan

Schemas should remain the same.

@arendjr arendjr requested review from a team July 15, 2025 12:48
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jul 15, 2025

⚠️ No Changeset found

Latest commit: 64b3bba

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions github-actions Bot added A-CLI Area: CLI A-Core Area: core A-Project Area: project A-Linter Area: linter A-Tooling Area: internal tools A-Diagnostic Area: diagnostocis L-Grit Language: GritQL labels Jul 15, 2025
@arendjr arendjr added the S-Help-wanted Status: you're familiar with the code base and want to help the project label Jul 15, 2025
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jul 15, 2025

CodSpeed Performance Report

Merging #6894 will not alter performance

Comparing arendjr:upgrade-schemars (64b3bba) with main (b7e2d4d)

Summary

✅ 114 untouched benchmarks

@dyc3
Copy link
Copy Markdown
Contributor

dyc3 commented Jul 15, 2025

All the failures are coming from our assertions in our codegen. I think that the openapi schema setting considers optional things to be T | null rather than T?. I've seen other openapi generators do something like this because they set nullable to true, but in openapi, to make something "optional" (as in the key may not exist) you have to omit it from the required field on the object.

@github-actions github-actions Bot added A-Formatter Area: formatter L-JavaScript Language: JavaScript and super languages labels Jul 16, 2025
@arendjr
Copy link
Copy Markdown
Contributor Author

arendjr commented Jul 16, 2025

Thanks, seems that is indeed related. By ignoring the assertion it confirms indeed that types that were treated as someProperty?: someType have now become someProperty: someType | null.

But I see a lot of other things have broken as well... going to park it for now. Hopefully we can finish it at some point.

@ematipico
Copy link
Copy Markdown
Member

The includes types aren't emitted anymore: https://github.com/arendjr/biome/blob/upgrade-schemars/packages%2F%40biomejs%2Fbackend-jsonrpc%2Fsrc%2Fworkspace.ts#L120-L123 (there's more than one instance)

@arendjr
Copy link
Copy Markdown
Contributor Author

arendjr commented Jul 16, 2025

Yeah, I know. That’s only one of the many issues…

@ematipico
Copy link
Copy Markdown
Member

That's been implemented

@ematipico ematipico closed this Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Core Area: core A-Diagnostic Area: diagnostocis A-Formatter Area: formatter A-Linter Area: linter A-Project Area: project A-Tooling Area: internal tools L-Grit Language: GritQL L-JavaScript Language: JavaScript and super languages S-Help-wanted Status: you're familiar with the code base and want to help the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants