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 preserve_order feature #562

Merged
merged 1 commit into from
Apr 4, 2023
Merged

Conversation

juhaku
Copy link
Owner

@juhaku juhaku commented Apr 4, 2023

This PR fixes preserve_order feature for utoipa-swagger-ui. Serde Value does not retain the order of elements from original type but reorders them resulting unexpected rendering of specification. This was caused by modifications that allowed external JSON docs to be rendered via SwaggerUi. This commit fixes this by keeping the original type and allowing use of serde_json::Value by wrapping them internally to a super type.

Fixes #561

This PR fixes `preserve_order` feature for `utoipa-swagger-ui`. Serde
`Value` does not retain the order of elements from original type but
reorders them resulting unexpected rendering of specification. This was
caused by modifications that allowed external JSON docs to be rendered
via `SwaggerUi`. This commit fixes this by keeping the original type and
allowing use of `serde_json::Value` by wrapping them internally to a
super type.
@juhaku juhaku force-pushed the fix-utoipa-swagger-ui-preserve-order branch from 2fa3322 to 237aa4b Compare April 4, 2023 18:58
@juhaku juhaku merged commit bab7960 into master Apr 4, 2023
@juhaku juhaku deleted the fix-utoipa-swagger-ui-preserve-order branch April 4, 2023 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released
Development

Successfully merging this pull request may close these issues.

Order of struct fields does not seem to be preserved even when using the preserve_order feature
1 participant