Skip to content
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

Fix schemas containing both properties and additionalProperties #845

Merged
merged 3 commits into from
Mar 24, 2022

Conversation

jcaesar
Copy link
Contributor

@jcaesar jcaesar commented Mar 5, 2022

Fixes #844 with a second rewrite rule in StructuralSchemaRewriter.

(Note: This doesn't work for #[serde(flatten)] foo: serde_json::Value. But I think that's the wrong thing to flatten anyway.)

…o serde(flatten)

See also: kube-rs#844

Signed-off-by: Julius Michaelis <gitter@liftm.de>
@codecov-commenter
Copy link

Codecov Report

Merging #845 (b89cc98) into master (0b5e803) will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #845      +/-   ##
==========================================
+ Coverage   70.31%   70.39%   +0.07%     
==========================================
  Files          59       59              
  Lines        4184     4195      +11     
==========================================
+ Hits         2942     2953      +11     
  Misses       1242     1242              
Impacted Files Coverage Δ
kube-core/src/schema.rs 90.00% <100.00%> (+2.50%) ⬆️
kube-derive/tests/crd_schema_test.rs 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b5e803...b89cc98. Read the comment docs.

Copy link
Member

@clux clux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the delay on this. tests look good.
one minor comment suggestion on the schema rewriter.

kube-core/src/schema.rs Show resolved Hide resolved
@clux clux added this to the 0.71.0 milestone Mar 24, 2022
@clux clux added the changelog-fix changelog fix category for prs label Mar 24, 2022
jcaesar and others added 2 commits March 24, 2022 21:26
Co-authored-by: Eirik A <sszynrae@gmail.com>
@clux clux merged commit 4d33057 into kube-rs:master Mar 24, 2022
@jcaesar jcaesar deleted the fix-flatten branch March 25, 2022 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-fix changelog fix category for prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid schema generated for #[serde(flatten)] HashMap<String, serde_json::Value>
3 participants