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

schemars_0_8 feature fails to compile when schemars/preserve_order is active #762

Closed
campbellcole opened this issue Jul 3, 2024 · 1 comment · Fixed by #764
Closed

Comments

@campbellcole
Copy link

When schemars/preserve_order is enabled, the Map type alias used in e.g. ObjectValidation::properties switches from BTreeMap to IndexMap, and IndexMap::append does not exist, causing this line to fail compilation:

properties.append(&mut object.properties);

This feature is enabled by default by rocket_okapi which is how I encountered this:
https://github.com/GREsau/okapi/blob/cd59fb61c5c8db1ce1976cb782efd544d8f99c38/rocket-okapi/Cargo.toml#L33-L36

I don't know off the top of my head what method IndexMap has that is equivalent to BTreeMap::append but I'd imagine this feature can be checked or a notice in the documentation could point out this incompatibility.

Thanks

@jonasbb
Copy link
Owner

jonasbb commented Jul 3, 2024

Thanks for reporting that. It is a bit unfortunate that the API differs here. I have a fix in #764 and tested it manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants