Generated Apis dont use the Refit Generator #1600
-
|
Hello, when I generate my Own Apis, the Refit Code Generator is not triggered. Is there a way to workaround that? If you want to elaborate I could also try to create a sample for it. Thank you very much in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The Refit source generator only runs against interfaces that:
Common reasons "my own APIs don't trigger the generator":
To use Refit interfaces in a separate project, add the If you can share a minimal repro (csproj + interface) we can confirm which of these it is. Otherwise the fix is almost always "add the Refit package reference to the project that contains the interface". |
Beta Was this translation helpful? Give feedback.
The Refit source generator only runs against interfaces that:
Refitpackage (so the generator is loaded), and[Get],[Post], etc.).Common reasons "my own APIs don't trigger the generator":
<PackageReference>withPrivateAssets/IncludeAssetsset so analyzers are excluded. Make sure the analyzer asset is included (the defaultRefit…