Home > Article > Backend Development > How to manage go-rest server based on OpenAPI 3.0?
My current API is written in Perl using Mojolicious and its OpenAPI plugin.
As far as I know, the advantage of this plugin is that it reads the OpenAPI specification and generates all routing and validation on server startup. Linking the endpoint to the actual method is done by defining the endpoint as the "x-mojo-to" attribute in the OpenAPI specification.
So I only need to write the method once, and when my specification is enhanced or extended, I don't lose the work I did and only need to write new methods.
How to achieve this in Go?
I can only find modules that generate boilerplate code that I have to populate with my methods.
But what happens when I have to extend or enhance the API specification? The boilerplate will be regenerated and I will have to redo the work.
The above is the detailed content of How to manage go-rest server based on OpenAPI 3.0?. For more information, please follow other related articles on the PHP Chinese website!