-
-
Couldn't load subscription status.
- Fork 82
Add support for schemars v0.9 #849
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
Conversation
This is mostly a copy-paste from the support for schemars v0.8. There are a couple of changes which make the v0.9 support a bit more messy, but otherwise it's not bad. This commit also duplicates the existing tests, which all pass. Once schemars v1.0 gets released it should hopefully require fewer changes to add support again. The big changes in schemars that cascade out to support here are - Schema is now just a very thin wrapper around serde_json::Value. This is rather convenient for defining schemas, less convenient for the transformations we need to make here. - Some of the trait methods on the JsonSchema trait have had their definitions change. It's possible the schemars::transform module could be used to make this cleaner. I haven't looked too deeply into what that would involve.
|
CI seems to be failing since schemars v0.9 has a MSRV of 1.74. What's the best way to make this work? I'm guessing this is the first dependency that has a no versions compatible with 1.71 |
|
Thank you for preparing this :) Feel free to bump the MSRV to 1.74. Here is an example of such a previous change: 2c6c51b |
|
I've bumped MSRV to 1.74 and added appropriate release notes. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #849 +/- ##
==========================================
+ Coverage 66.70% 67.36% +0.65%
==========================================
Files 34 35 +1
Lines 8227 8683 +456
==========================================
+ Hits 5488 5849 +361
- Misses 2739 2834 +95 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
It took a few tries to fix all the clippy warnings (+ one bug that I have added a test case for) but this should now be ready for review. |
|
Thank you for the great PR. This looks mostly like mechanical changes to adapt to the new
One notes:
|
This is mostly a copy-paste from the support for schemars v0.8. There are a couple of changes which make the v0.9 support a bit more messy, but otherwise it's not bad. This commit also duplicates the existing tests, which all pass. Once schemars v1.0 gets released it should hopefully require fewer changes to add support again.
The big changes in schemars that cascade out to support here are
It's possible the schemars::transform module could be used to make this cleaner. I haven't looked too deeply into what that would involve.
Fixes #842