Skip to content

Plugin Architecture

Tim Burks edited this page Jan 25, 2017 · 7 revisions

openapic can invoke third-party OpenAPI tools using a plugin architecture that is similar to the one used by protoc, the Protocol Buffer compiler.

openapic plugins can be written in any language, and interface with openapic by reading from stdin and writing to stdout. When openapic calls a plugin, it launches the plugin process and writes a PluginRequest object to the plugin's stdin and waits for the plugin to write a PluginResponse message to its stdout.

Plugins are invoked by passing an option to openapic of the form --<plugin>_out=<path> where path is a directory where the plugin's output should be written. Plugin binaries are expected to be named openapi_<plugin> and in the current search path. For example --go_service_out=. will invoke the openapi_go_service plugin and write its output in the current working directory.

For details of the plugin interface and examples, see the plugins directory.

Clone this wiki locally