FEAT: Generate OpenAPI Spec
Having documentation on the API endpoints and usage is fantastic, but if there were a generated OpenAPI spec, we could create tooling to easily interact with the API rather than needing to manually code each endpoint.
Thanks for the request. This may take long time to implement since creating a doc in new format will take a week or two of full time daily work which is something that is not currently feasible.
Out of curiosity, are there not tooling that can generate a spec from the running codebase?
I know at least on the java side, tools like springdoc exists which generates a openapi spec at runtime from the running code.
@ruifung I use Swagger for my Golang APIs. All it takes is a bit of documentation at the function level.
I meant for dotnet, because a short while ago I dabbled with the idea of writing a more comprehensive pulumi provider for T-DNS... and promptly shelved it because translating that API markdown file into golang is not something I feel like doing manually at the time.
It looks like ASP.NET Core has native support for the OpenAPI Spec. https://learn.microsoft.com/en-us/aspnet/core/fundamentals/openapi/overview?view=aspnetcore-10.0&preserve-view=true
It looks like ASP.NET Core has native support for the OpenAPI Spec. https://learn.microsoft.com/en-us/aspnet/core/fundamentals/openapi/overview?view=aspnetcore-10.0&preserve-view=true
I have tried using that but it seems to work only with standard way of writing ASP.NET apps and not the way its being used in the DNS server.
Another tissue is that the API is not faithful to the RESTful principles. Some API endpoints are specifically designed for the dashboard. Therefore they contain state for the dashboards. In order to be able to use pure RESTful OpenAPI specs, there is some extra work to be done between the backend and frontend communication, roles and responsibilities.
Another tissue is that the API is not faithful to the RESTful principles. Some API endpoints are specifically designed for the dashboard. Therefore they contain state for the dashboards. In order to be able to use pure RESTful OpenAPI specs, there is some extra work to be done between the backend and frontend communication, roles and responsibilities.
True. The project does not implement REST API. Its just a simple HTTP API that works with GET or POST for most calls.