-
-
Notifications
You must be signed in to change notification settings - Fork 266
Description
I've been working on Schemars for a little over 2 years now - it's always just been a personal project of mine, which does mean its progress depends on my free time and motivation. But I am certainly still here, and plan to continue working on it!
With that in mind, I thought it was worth recording some thoughts about where I see the project going, and specifically what I think is necessary to reach something I can could version 1.0.
I'd love to reach a point where Rust library authors can implement JsonSchema
on their public types (probably depending on feature flags), much like is commonly done for serde::Serialize
/Deserialize
. But I'm not comfortable encouraging this too much yet, as I don't think the Schemars API is quite yet stable enough - there are still some enhancements and changes that I would love to see implemented which may require breaking changes to the current API. So, to be comfortable in releasing Schemars v1.0, I'd like to be reasonably confident that all desired enhancements can be implemented without breaking changes. Ideally, there would never need to be a v2.0. Off the top of my head, I would like to have solutions for:
generation of separate schemas for serialization/deserialization (Support generating multiple schemas (for serialize vs deserialize) from the same struct #48)DONE in v1.0.0-alpha.15differentiation of distinct types with the same name (Schemars overwrites declarations if there are structs with the same name #62)DONE in v0.8.14handling of different JSON schema versions/dialects (and how to handle future JSON schema versions), including JSON schema draft 2020-12 / openapi 3.1DONE in v1.0.0-alpha.6- easier manual building of schemas - I envision this looking a bit like the
debug_*
helper methods onFormatter
that are useful for manually implementingDebug
Note that these do not necessarily have to be implemented for 1.0, I just need to know that they could be done without breaking changes. There are a few ways to achieve this - it could be a proof-of-concept implementation, or just an API proposal with a vague idea of how that API could be implemented.
There are some more "indirect" improvements I'd like to get done, like writing up some contributor guidelines to make it easier for people to create useful PRs. I'm also interested in looking into the performance of Schemars, in particular the compile-time performance, including #[derive(JsonSchema)]
. I assume that the actual schema generation at runtime is rarely in a hot path, so runtime performance is less of a concern (but not unimportant!), I would be very interested to hear if you don't agree.
And finally, I'd like to take this opportunity to thank the community contributors - all of the bug reports, enhancement suggestions, and code contributions have been a massive help, so thank you all! ❤️