Update to schemars 1.0#1780
Conversation
Signed-off-by: Danil-Grigorev <[email protected]>
Signed-off-by: Danil-Grigorev <[email protected]>
| /// A JSON Schema object. | ||
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default, JsonSchema)] | ||
| #[serde(rename_all = "camelCase", default)] | ||
| pub struct SchemaObject { |
There was a problem hiding this comment.
Presumably many of these types here were lifted from schemars 0.8?
Are they necessary for us or is it mostly an api convenience?
Secondly, are they necessary to stay here as pub? They don't seem used in the examples. EDIT: tried out; you can basically remove pub from all of them except the original StructuralSchemaRewriter.
There was a problem hiding this comment.
I removed those pub keywords. It is needed to preserve logic unchanged, it works well, and edge cases where it fails are related (sourced) to the schemars changes regarding updates to serde(flatten) handling. I can expand on the issue later if needed.
These structures come from v0.8 tag in schemars, although I can also remove dangling parts which are not currently used if the size of added definitions matters. Simply having them in place makes implementing overrides easier, then operating on raw serde_json::Value, and I suspect rewriting current logic to the upstream suggested migration guide would still require implementing similar structures there and then.
There was a problem hiding this comment.
Yeah. Makes sense. As long as it's not part of our public API this is a good step forward either way. 👍
Signed-off-by: Danil-Grigorev <[email protected]>
b25d329 to
1c46714
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1780 +/- ##
=======================================
+ Coverage 76.5% 76.6% +0.1%
=======================================
Files 84 84
Lines 7896 7909 +13
=======================================
+ Hits 6038 6052 +14
+ Misses 1858 1857 -1
🚀 New features to boost your workflow:
|
Signed-off-by: Danil-Grigorev <[email protected]>
|
actually possibly a legit failure now in |
Signed-off-by: Danil-Grigorev <[email protected]>
Motivation
Manually update
schemarsto 1.0 to support future changes.Solution
Re-implement some of the breaking changes to allow existing
CRDparsing logic to be preserved, as they rely on structured schema instead ofserde_json::Value.