-
Notifications
You must be signed in to change notification settings - Fork 224
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
ToResponse
response
derive should be possible to namespace
#851
Comments
Oh snap. This would need I am not fond of changing the attribute name to something like Some things to consider:
Perhaps now there are no good way around the issue e.g. If new type pattern cannot be leveraged correctly then I guess the only option for now is to not to use the |
Ok that is very unfortunate. |
One way is to use the tuples to define responses with the |
Ok thank you, I'll do that as long as deriving |
I am currently writing a very simple application using rocket and there I am using the Responder derive macro to make my enum response types.
Like this:
And this works perfectly fine.
But as soon as I want to put these enums in my uitopa OpenAPI docs I get a problem.
To do it I need to annotate my enums with the ToResponse derive macro. But that one also has a
response
derive available inside the enum.So if I change my above example to this:
I get this error:
So my proposal would be to be able to do something like this:
Because AFAIK namespacing it like this
utoipa::response
does not work.Sadly I cannot really do it myself as I have no experience with any kind of Rust macros.
Maybe this is also something that rocket should change.
The text was updated successfully, but these errors were encountered: