Any good C# OpenApi document generators?
Any good C# OpenApi document generators?
29 Sep 2021, 19:28
I have a non-MVC .NET web service that I want to generate an OpenApi doc for. Ideally I want to reflect off my classes and build up a document object model (DOM) tree for OpenApi and then serialize it as JSON or YAML.
The closest thing I can find to a library that does that in .NET 5 is Microsoft's openapi.net, but that throws an assembly load exception. I refuse to use Nuget for a plethora of reasons, so I would want to check in any third party libraries into our version control system.
Is there any .NET 5 library that will let me build a DOM tree for OpenApi and then serialize that DOM tree as JSON or YAML, or is OpenApi just not mature enough yet to do this? I suppose I could roll my own, but I don't want to have to implement every detail of the OpenApi spec.
amusleh
30 Sep 2021, 11:31
Hi,
There is no doc generator available for proto files in .NET, but you can use this Go proto doc generator: gendoc package - github.com/pseudomuto/protoc-gen-doc - pkg.go.dev
It allows you to generate docs in different formats easily, we also use it to generate the Open API documentation API references.
OpenAPI.NET is a library that allows you to use Open API on your .NET apps, it doesn't generate docs for proto files or Open API.
@amusleh