-
-
Notifications
You must be signed in to change notification settings - Fork 746
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
Use of constants in HTTP attributes does not generate proxies #602
Comments
Same problem here! This feature is a nice to have, it would save a lot of work in the future for those who have a lot of endpoints mapped through a string literal instead of a const. |
This is the same as #263 and would require significant work in the parser to support. I'd accept a PR if someone wants to undertake that work. This comment still stands: #263 (comment) |
Ok, @onovotny is there any start point where I could take a look to investigate the problem? I would like to see how much work would it require so I could see if I can accomplish it in my free time :) |
Should be implemented in #1029 |
Please try v6.0-preview.84 and file bugs as you come across them. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Might be related to #263, however the error and use case are different.
I have the base address (i.e. RoutePrefix) for my API controllers defined in a constants file. I was trying to consume the Refit API from UWP and was getting the error message:
'IUserApiV1 doesn't look like a Refit interface. Make sure it has at least one method with a Refit HTTP method attribute and Refit is installed in the project.'
I created a simple project and noticed I got the autogenerated class in ILSpy. I then started trying to reproduce to work out why it wasn't being added.
It turns out that defining the value like this:
Refit will not find the interface. If I remove the constant, it then correctly discovers the interface and builds the proxy.
The text was updated successfully, but these errors were encountered: