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

Incorrect imports of schemars type #1049

Closed
ralpha opened this issue Oct 13, 2022 · 2 comments · Fixed by #1050
Closed

Incorrect imports of schemars type #1049

ralpha opened this issue Oct 13, 2022 · 2 comments · Fixed by #1050
Assignees
Labels
bug Something isn't working core generic apimachinery style work

Comments

@ralpha
Copy link

ralpha commented Oct 13, 2022

Current and expected behavior

Compile error on mismatched types.
The hard coded import in schema.rs file can change with feature flags.
This type changes with the preserve_order flag in schemars.

Possible solution

This line:

use std::collections::btree_map::Entry;

Should be changed to:

use schemars::MapEntry as Entry;

or just use schemars::MapEntry; and change the match lower down in the code (line 104-114).

Additional context

Transfer of issue from GREsau/okapi#109

Relevant code in schemars https://github.com/GREsau/schemars/blob/5268080b014152912a910e3fe8524c4c876407de/schemars/src/lib.rs#L306-L309

Environment

All

Configuration and features

No response

Affected crates

kube-core

Would you like to work on fixing this bug?

no

@ralpha
Copy link
Author

ralpha commented Oct 13, 2022

This might also be a good first issue for someone.

@nightkr
Copy link
Member

nightkr commented Oct 14, 2022

Ouch, good catch.

@nightkr nightkr self-assigned this Oct 14, 2022
@nightkr nightkr added the core generic apimachinery style work label Oct 14, 2022
nightkr added a commit to nightkr/kube-rs that referenced this issue Oct 14, 2022
Fixes kube-rs#1049

Signed-off-by: Teo Klestrup Röijezon <teo@nullable.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core generic apimachinery style work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants