Skip to content

Adds schemars support and forwards dependency features conditionally#45

Open
StefanTerdell wants to merge 3 commits intofosskers:masterfrom
StefanTerdell:schemars
Open

Adds schemars support and forwards dependency features conditionally#45
StefanTerdell wants to merge 3 commits intofosskers:masterfrom
StefanTerdell:schemars

Conversation

@StefanTerdell
Copy link
Copy Markdown

This PR adds optional support for schemars through a feature flag. It also makes use of the optional dependency feature pattern to forward activation of the serde feature to - and schemars-related features for - either and indexmap when those are active as well.

Hope you like it :)

@StefanTerdell
Copy link
Copy Markdown
Author

@fosskers Sorry about tagging, but not sure how notifications work on GH myself TBH :) Any thoughts on this?

@fosskers
Copy link
Copy Markdown
Owner

fosskers commented Jan 8, 2026

3 weeks of silence from me definitely warrants a ping, yes.

Since this is feature-gated it's basically fine, but my main concern is whether schemars is flash-in-the-pan and not something as permanent as say serde is. I wouldn't to add this just to have to rip it out again in a year when the new cool thing appears. Happy to be convinced otherwise.

@StefanTerdell
Copy link
Copy Markdown
Author

Well, it's been around for about a decade and is the basis of most Open Api generator libs I've used so far. It's also getting 15m monthly downloads, if that means anything :)

@StefanTerdell
Copy link
Copy Markdown
Author

I made a similar pull request for IpNet that was just merged and released: krisprice/ipnet#67.

IpNet is used by sqlx among others, so I hope this helps make the case for the wide(ning) adoption of schemars throughout stable crates in the ecosystem :)

I am using my fork as a git dependency for now so there's really no rush on my end, just mentioning it to provide some more context.

@StefanTerdell StefanTerdell mentioned this pull request Mar 6, 2026
@MOZGIII
Copy link
Copy Markdown

MOZGIII commented Mar 17, 2026

schemars is pretty widely-adopted by now; this is a to-go JSON schema tooling in rust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants