Closed yanxiaodi closed 3 years ago
I would presume your idea was inspired by what generated by NSwag. If so, you may be interested in looking at https://github.com/zijianhuang/openapiclientgen particularly comparing what generated by OpenApiClientGen from pet.yaml and mcp.yaml with what generated by NSwag.
I don't really have strong opinion on whether generating interface is beneficial overall to application programmers. The priority probably depends how popular application programmers would utilize the interface.
I had grown up during the age when development framework like .NET framework did not provide built-in DI mechanisms, so we had used various design patterns for DI. These days, I would use the built-in DI of .NET Core as last resort for the sake of DI.
Nevertheless, I would keep this case open to see how many developers would love to see the interface in the generated codes.
Thanks. I think one possible option is to provide an switch to control if the interfaces would be generated. I'll try it. I checked openapiclientgen and it would be a good idea because I don't really like the code generated by NSwag.
Good to hear, and you will have fun of using CodeDOM. :) And if you haven't, you may view my CodeProject articles some of which compare with Swagger and NSwag, so you may be understanding more about the functional scope and the business scope of WebApiClientGen and OpenApiClientGen.
too old , no progress
Just a proposal. It would be better if webapiclientgen can generate interfaces for API clients because now we use Dependency Injection widely in .NET Core applications. Thanks.