I use a lot of ASP.NET Core web API's which use swagger and when consuming these API's there is a lot of copy pasting of Request, Response and Dto's.
F# have Type Providers https://fsharp.github.io/FSharp.Data/library/JsonProvider.html which sounds very good for consuming API's giving me intellisense and compile errors if types or names of external DTO's do not match.
If possible I would like to create a F# class lib which would use Type providers and point to the swagger json file to generate the classes, I would then like to use the F# class lib in my C# solution as there is no native Type provider from what I know in C# yet.
If this can work, what I hope I would gain is
Any input to if this is possible or if there are better solutions?
As the Swagger TypeProvider is generative, this is possible.
Other solutions include NSwag or a manual workflow using the generator on swagger.io