Dreamescaper / GenerateAspNetCoreClient

DotNet tool to generate HTTP client classes from ASP.NET Core api controllers.
MIT License
63 stars 5 forks source link

Could this become a source generator instead of a tool? #15

Open qrzychu opened 1 year ago

qrzychu commented 1 year ago

I really the idea behind this tool, but it would be great to run this as a source generator, so that the API interfaces are updated pretty much every time you save your files.

Dreamescaper commented 1 year ago

With the current approach - no. It uses ApiExplorer, for which I basically need to build and run the project.

The problem is that it's hard to get all the endpoint information solely from source code. For example, you can add Versioning package, and it will change all your routes, even though all the controllers are the same.

It might be possible to build a source generator for 90% of cases though. E.g. based solely on controller and default attributes.