Skip to content

feat: Support serde(flatten) in IntoParams derive - #1572

Open
esavier wants to merge 1 commit into
juhaku:masterfrom
esavier:esavier/feat/1531/0/support_flatten_in_intoparams
Open

feat: Support serde(flatten) in IntoParams derive#1572
esavier wants to merge 1 commit into
juhaku:masterfrom
esavier:esavier/feat/1531/0/support_flatten_in_intoparams

Conversation

@esavier

@esavier esavier commented Jun 15, 2026

Copy link
Copy Markdown

fixes: #1531

Expand flattened fields that implement IntoParams into the parent parameter list instead of generating a parameter for the flattened field itself.

@esavier

esavier commented Jun 15, 2026

Copy link
Copy Markdown
Author

i hope i did this correctly, please add your comments if we think this should be done differently

@CommanderStorm

Copy link
Copy Markdown
Contributor

Can you compare your PR with the other open PR implementing this?
Which one is better and why?

Your code does not have the weird utoipa-gen/tests/into_params_test.rs but your code is also a lot shorter.
IF there is a difference, make sure to also add a testcase for that difference, as that would mean that the tests are not 100% 😉?

@esavier

esavier commented Jun 15, 2026

Copy link
Copy Markdown
Author

Yup, i will do what i can.
at a glance both options are okay. I do not think the other PR is necessarily disadventagious, but i am new here, i will check how the rest of the code looks like and what we can do. Please give me time until tomorrow.

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 this pull request may close these issues.

How to flatten a nested struct for display

2 participants