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

Auto-collect schema references for IntoResponses-style responses #1224

Open
plv opened this issue Dec 2, 2024 · 0 comments
Open

Auto-collect schema references for IntoResponses-style responses #1224

plv opened this issue Dec 2, 2024 · 0 comments

Comments

@plv
Copy link

plv commented Dec 2, 2024

Hi, thanks for all the hard work on utoipa!

In #1071 I see you added auto collection of tuple responses for utoipa::path if the responses are tuple-style (i.e. responses((status = 200, description = "200", body = FooStruct)), but that IntoResponses-style (i.e. responses(FooStruct)) is not supported.

What happens is that if the response is a struct with named fields has nested structs (with their own respective ToSchema implementations), there will be hanging $refs that are not included. My current workaround is to force inlining with #[schema(inline)] on these fields, but I'd much prefer if the $refs were automatically collected

Is this a misuse/misunderstanding of IntoResponses? Or will rescursive and automatic components/$ref collection be implemented for IntoResponses in the future?

Thanks again!

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

No branches or pull requests

1 participant