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 discover responses #1094

Open
DenuxPlays opened this issue Oct 5, 2024 · 5 comments
Open

Auto discover responses #1094

DenuxPlays opened this issue Oct 5, 2024 · 5 comments

Comments

@DenuxPlays
Copy link

Hey,

just like with request_body and response schemas whole responses (with traits ToResponse and IntoResponses) do not get auto discovered when used in the paths macros.

@juhaku
Copy link
Owner

juhaku commented Oct 5, 2024

Yup, that's true, as indicated here #1065 there is not yet any implementation for them to be automatically recognized. Not sure whether I will do it to the first version of 5.0.0 and there might be some fundamental changes to be made for those traits as I am not very convinced that they perform the best of their intended use case.

@DenuxPlays
Copy link
Author

Okay great to hear.
I agree I found it very confusing working the first time with ToResponse and IntoResponses but not sure if I can speak for the whole community.

@juhaku
Copy link
Owner

juhaku commented Oct 5, 2024

Yeah, I'm kind of tempted to deprecate them and even perhaps to remove them 😅 But there are people using them so not really viable option as of yet. I kind of want to find a way to leverage the ToSchema as a base and then coating that with additional data for making it a "response" what can be referenced and what not later on. Now the ToResponse and IntoResponses does whole bunch of needless processing and adds to the complexity too much maintenance overhead.

@DenuxPlays
Copy link
Author

I guess deprecating it would be a good idea if a better solution can be found.
I would be fine with removal as this is a breaking change release but again I cannot speak for the community.
I think leveraging the ToSchema trait would be a good idea.

@juhaku
Copy link
Owner

juhaku commented Oct 7, 2024

Related issues #1025 #465

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

2 participants