-
Notifications
You must be signed in to change notification settings - Fork 220
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
Order of struct fields does not seem to be preserved even when using the preserve_order feature #561
Comments
Hey, this seems to be regression bug in the I will fix as a next thing on my list.
This is not directly possible with utoipa since paths are sorted in UI itself. https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md#display In order to sort paths you need to provide |
Thank you for the quickr response! Do you know when it will appear via |
To my knowledge it should be already available since I have already released it to the crates. https://crates.io/crates/utoipa-swagger-ui |
Thanks, I can confirm it works :-) |
Great |
Issue #428 addressed the question of preserving the order of fields as declared in a struct, but when I add this feature to Cargo.toml, the fields are still sorted in the Schema.
For example, suppose I modify the todo-axum example's Cargo.toml so that we have:
...and main.rs so that we have this:
The result is that the fields are still in alphabetical order:
![image](https://user-images.githubusercontent.com/9720450/229828385-00006e88-2688-4e7a-89c5-67e7719d9c03.png)
Am I doing something wrong, have I misunderstood the purpose of that change, or is it something else entirely?
Similarly, is it possible to display the paths in the order they're declared in the
openapi
macro'spaths(...)
declaration?The text was updated successfully, but these errors were encountered: